Ardour  9.0-pre0-582-g084a23a80d
midi_scene_changer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2014 David Robillard <d@drobilla.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include <glibmm/threads.h>
23 
24 #include "ardour/midi_port.h"
25 #include "ardour/scene_changer.h"
26 
27 namespace ARDOUR
28 {
29 
30 class MIDISceneChange;
31 
33 {
34  public:
37 
39  void set_input_port (std::shared_ptr<MidiPort>);
40  void set_output_port (std::shared_ptr<MidiPort>);
41 
42  uint8_t bank_at (samplepos_t, uint8_t channel);
43  uint8_t program_at (samplepos_t, uint8_t channel);
44 
45  void set_recording (bool);
47 
51 
55 
56  private:
57  typedef std::multimap<samplepos_t,std::shared_ptr<MIDISceneChange> > Scenes;
58 
59  std::shared_ptr<MidiPort> input_port;
60  std::shared_ptr<MidiPort> output_port;
61  Glib::Threads::RWLock scene_lock;
63  bool _recording;
66  unsigned short current_bank;
69 
71  bool recording () const;
72  void jump_to (int bank, int program);
73  void rt_deliver (MidiBuffer&, samplepos_t, std::shared_ptr<MIDISceneChange>);
74  void non_rt_deliver (std::shared_ptr<MIDISceneChange>);
75 
76  void bank_change_input (MIDI::Parser&, unsigned short, int channel);
79 
81 };
82 
83 } // namespace
84 
std::list< Location * > LocationList
Definition: location.h:251
uint8_t program_at(samplepos_t, uint8_t channel)
std::shared_ptr< MidiPort > input_port
void jump_to(int bank, int program)
void gather(const Locations::LocationList &)
void set_output_port(std::shared_ptr< MidiPort >)
void locate(samplepos_t)
std::multimap< samplepos_t, std::shared_ptr< MIDISceneChange > > Scenes
uint8_t bank_at(samplepos_t, uint8_t channel)
PBD::ScopedConnectionList incoming_connections
void program_change_input(MIDI::Parser &, MIDI::byte, int channel)
void run(samplepos_t start, samplepos_t end)
Glib::Threads::RWLock scene_lock
std::shared_ptr< MidiPort > output_port
PBD::Signal< void()> MIDIOutputActivity
void non_rt_deliver(std::shared_ptr< MIDISceneChange >)
void rt_deliver(MidiBuffer &, samplepos_t, std::shared_ptr< MIDISceneChange >)
void set_input_port(std::shared_ptr< MidiPort >)
void bank_change_input(MIDI::Parser &, unsigned short, int channel)
PBD::Signal< void()> MIDIInputActivity
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplepos_t samplepos_t