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

« back to all changes in this revision

Viewing changes to libs/surfaces/mackie/strip.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
#ifndef __ardour_mackie_control_protocol_strip_h__
 
2
#define __ardour_mackie_control_protocol_strip_h__
 
3
 
 
4
#include <string>
 
5
#include <iostream>
 
6
 
 
7
#include "evoral/Parameter.hpp"
 
8
 
 
9
#include "pbd/property_basics.h"
 
10
#include "pbd/signals.h"
 
11
 
 
12
#include "ardour/types.h"
 
13
#include "control_protocol/types.h"
 
14
 
 
15
#include "control_group.h"
 
16
#include "types.h"
 
17
#include "midi_byte_array.h"
 
18
#include "device_info.h"
 
19
 
 
20
namespace ARDOUR {
 
21
        class Route;
 
22
        class Bundle;
 
23
        class ChannelCount;
 
24
}
 
25
 
 
26
namespace Mackie {
 
27
 
 
28
class Control;
 
29
class Surface;
 
30
class Button;
 
31
class Pot;
 
32
class Fader;
 
33
class Meter;
 
34
class SurfacePort;
 
35
 
 
36
struct GlobalControlDefinition {
 
37
    const char* name;
 
38
    int id;
 
39
    Control* (*factory)(Surface&, int index, const char* name, Group&);
 
40
    const char* group_name;
 
41
};
 
42
 
 
43
/**
 
44
        This is the set of controls that make up a strip.
 
45
*/
 
46
class Strip : public Group
 
47
{
 
48
public:
 
49
        Strip (Surface&, const std::string & name, int index, const std::map<Button::ID,StripButtonInfo>&);
 
50
        ~Strip();
 
51
 
 
52
        boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
 
53
 
 
54
        void add (Control & control);
 
55
        int index() const { return _index; } // zero based
 
56
        
 
57
        void set_route (boost::shared_ptr<ARDOUR::Route>, bool with_messages = true);
 
58
 
 
59
        // call all signal handlers manually
 
60
        void notify_all();
 
61
 
 
62
        void handle_button (Button&, ButtonState bs);
 
63
        void handle_fader (Fader&, float position);
 
64
        void handle_pot (Pot&, float delta);
 
65
 
 
66
        void periodic (uint64_t now_usecs);
 
67
 
 
68
        MidiByteArray display (uint32_t line_number, const std::string&);
 
69
        MidiByteArray blank_display (uint32_t line_number);
 
70
 
 
71
        void zero ();
 
72
 
 
73
        void flip_mode_changed (bool notify=false);
 
74
 
 
75
        void lock_controls ();
 
76
        void unlock_controls ();
 
77
        bool locked() const { return _controls_locked; }
 
78
 
 
79
        void gui_selection_changed (const ARDOUR::StrongRouteNotificationList&);
 
80
  
 
81
        void notify_metering_state_changed();
 
82
 
 
83
private:
 
84
        Button*  _solo;
 
85
        Button*  _recenable;
 
86
        Button*  _mute;
 
87
        Button*  _select;
 
88
        Button*  _vselect;
 
89
        Button*  _fader_touch;
 
90
        Pot*     _vpot;
 
91
        Fader*   _fader;
 
92
        Meter*   _meter;
 
93
        int      _index;
 
94
        Surface* _surface;
 
95
        bool     _controls_locked;
 
96
        bool     _transport_is_rolling;
 
97
        bool     _metering_active;
 
98
        uint64_t _reset_display_at;
 
99
        boost::shared_ptr<ARDOUR::Route> _route;
 
100
        PBD::ScopedConnectionList route_connections;
 
101
 
 
102
        float _last_gain_position_written;
 
103
        float _last_pan_azi_position_written;
 
104
        float _last_pan_width_position_written;
 
105
 
 
106
        void notify_solo_changed ();
 
107
        void notify_mute_changed ();
 
108
        void notify_record_enable_changed ();
 
109
        void notify_gain_changed (bool force_update = true);
 
110
        void notify_property_changed (const PBD::PropertyChange&);
 
111
        void notify_panner_azi_changed (bool force_update = true);
 
112
        void notify_panner_width_changed (bool force_update = true);
 
113
        void notify_active_changed ();
 
114
        void notify_route_deleted ();
 
115
        
 
116
        void update_automation ();
 
117
        void update_meter ();
 
118
 
 
119
        std::string vpot_mode_string () const;
 
120
 
 
121
        void queue_display_reset (uint32_t msecs);
 
122
        void clear_display_reset ();
 
123
        void reset_display ();
 
124
        void do_parameter_display (ARDOUR::AutomationType, float val);
 
125
        
 
126
        typedef std::map<std::string,boost::shared_ptr<ARDOUR::Bundle> > BundleMap;
 
127
        BundleMap input_bundles;
 
128
        BundleMap output_bundles;
 
129
 
 
130
        void build_input_list (const ARDOUR::ChanCount&);
 
131
        void build_output_list (const ARDOUR::ChanCount&);
 
132
        void maybe_add_to_bundle_map (BundleMap& bm, boost::shared_ptr<ARDOUR::Bundle>, bool for_input, const ARDOUR::ChanCount&);
 
133
 
 
134
        void select_event (Button&, ButtonState);
 
135
        void vselect_event (Button&, ButtonState);
 
136
        void fader_touch_event (Button&, ButtonState);
 
137
 
 
138
        std::vector<Evoral::Parameter> possible_pot_parameters;
 
139
        void next_pot_mode ();
 
140
        void set_vpot_parameter (Evoral::Parameter);
 
141
 
 
142
        void reset_saved_values ();
 
143
 
 
144
        std::map<Evoral::Parameter,Control*> control_by_parameter;
 
145
};
 
146
 
 
147
}
 
148
 
 
149
#endif /* __ardour_mackie_control_protocol_strip_h__ */