~ubuntu-branches/ubuntu/utopic/ardour3/utopic

« back to all changes in this revision

Viewing changes to libs/ardour/ardour/mute_master.h

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler
  • Date: 2013-09-21 19:05:02 UTC
  • Revision ID: package-import@ubuntu.com-20130921190502-8gsftrku6jnzhd7v
Tags: upstream-3.4~dfsg
ImportĀ upstreamĀ versionĀ 3.4~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2009 Paul Davis
 
3
 
 
4
    This program is free software; you can redistribute it and/or modify
 
5
    it under the terms of the GNU General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or
 
7
    (at your option) any later version.
 
8
 
 
9
    This program is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
    GNU General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU General Public License
 
15
    along with this program; if not, write to the Free Software
 
16
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
17
 
 
18
*/
 
19
 
 
20
#ifndef __ardour_mute_master_h__
 
21
#define __ardour_mute_master_h__
 
22
 
 
23
#include "evoral/Parameter.hpp"
 
24
#include "pbd/signals.h"
 
25
#include "pbd/stateful.h"
 
26
#include <string>
 
27
 
 
28
#include "ardour/session_handle.h"
 
29
 
 
30
namespace ARDOUR {
 
31
 
 
32
class Session;
 
33
 
 
34
class MuteMaster : public SessionHandleRef, public PBD::Stateful
 
35
{
 
36
  public:
 
37
        /** deliveries to mute when the channel is "muted" */
 
38
        enum MutePoint {
 
39
                PreFader  = 0x1, ///< mute all pre-fader sends
 
40
                PostFader = 0x2, ///< mute all post-fader sends
 
41
                Listen    = 0x4, ///< mute listen out
 
42
                Main      = 0x8  ///< mute main out
 
43
        };
 
44
 
 
45
        static const MutePoint AllPoints;
 
46
 
 
47
        MuteMaster (Session& s, const std::string& name);
 
48
        ~MuteMaster() {}
 
49
 
 
50
        bool muted_by_self () const { return _muted_by_self && (_mute_point != MutePoint (0)); }
 
51
        bool muted_by_self_at (MutePoint mp) const { return _muted_by_self && (_mute_point & mp); }
 
52
        bool muted_by_others_at (MutePoint mp) const;
 
53
 
 
54
        gain_t mute_gain_at (MutePoint) const;
 
55
 
 
56
        void set_muted_by_self (bool yn) { _muted_by_self = yn; }
 
57
 
 
58
        void mute_at (MutePoint);
 
59
        void unmute_at (MutePoint);
 
60
 
 
61
        void set_mute_points (const std::string& mute_point);
 
62
        void set_mute_points (MutePoint);
 
63
        MutePoint mute_points() const { return _mute_point; }
 
64
 
 
65
        void set_soloed (bool);
 
66
        void set_solo_ignore (bool yn) { _solo_ignore = yn; }
 
67
 
 
68
        PBD::Signal0<void> MutePointChanged;
 
69
 
 
70
        XMLNode& get_state();
 
71
        int set_state(const XMLNode&, int version);
 
72
 
 
73
  private:
 
74
        volatile MutePoint _mute_point;
 
75
        volatile bool      _muted_by_self;
 
76
        volatile bool      _soloed;
 
77
        volatile bool      _solo_ignore;
 
78
};
 
79
 
 
80
} // namespace ARDOUR
 
81
 
 
82
#endif /*__ardour_mute_master_h__ */