ardour
midi_scene_changer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 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 __libardour_midi_scene_changer_h__
21 #define __libardour_midi_scene_changer_h__
22 
23 #include <glibmm/threads.h>
24 
25 #include "ardour/scene_changer.h"
26 
27 namespace ARDOUR
28 {
29 
30 class MIDISceneChange;
31 
33 {
34  public:
37 
38  void run (framepos_t start, framepos_t end);
39  void set_input_port (MIDI::Port*);
41 
42  uint8_t bank_at (framepos_t, uint8_t channel);
43  uint8_t program_at (framepos_t, uint8_t channel);
44 
45  void set_recording (bool);
46  void locate (framepos_t);
47 
50  PBD::Signal0<void> MIDIInputActivity;
51 
54  PBD::Signal0<void> MIDIOutputActivity;
55 
56  private:
57  typedef std::multimap<framepos_t,boost::shared_ptr<MIDISceneChange> > Scenes;
58 
59  MIDI::Port* input_port;
61  Glib::Threads::RWLock scene_lock;
62  Scenes scenes;
63  bool _recording;
66  unsigned short current_bank;
69 
70  void gather (const Locations::LocationList&);
71  bool recording () const;
72  void jump_to (int bank, int program);
75 
76  void bank_change_input (MIDI::Parser&, unsigned short, int channel);
77  void program_change_input (MIDI::Parser&, MIDI::byte, int channel);
78  void locations_changed ();
79 
81 };
82 
83 } // namespace
84 
85 #endif /* __libardour_midi_scene_changer_h__ */
Glib::Threads::RWLock scene_lock
void bank_change_input(MIDI::Parser &, unsigned short, int channel)
std::list< Location * > LocationList
Definition: location.h:167
void set_input_port(MIDI::Port *)
PBD::Signal0< void > MIDIInputActivity
void rt_deliver(MidiBuffer &, framepos_t, boost::shared_ptr< MIDISceneChange >)
PBD::ScopedConnectionList incoming_connections
PBD::Signal0< void > MIDIOutputActivity
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
Definition: region.cc:63
uint8_t bank_at(framepos_t, uint8_t channel)
void gather(const Locations::LocationList &)
uint8_t program_at(framepos_t, uint8_t channel)
void non_rt_deliver(boost::shared_ptr< MIDISceneChange >)
Definition: amp.h:29
void program_change_input(MIDI::Parser &, MIDI::byte, int channel)
void set_output_port(boost::shared_ptr< MidiPort >)
int64_t framepos_t
Definition: types.h:66
void run(framepos_t start, framepos_t end)
boost::shared_ptr< MidiPort > output_port
void jump_to(int bank, int program)
std::multimap< framepos_t, boost::shared_ptr< MIDISceneChange > > Scenes