mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Merge big changes (mostly Controllable) from trunk
git-svn-id: svn://localhost/ardour2/branches/midi@682 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
edd841895b
commit
50a3102b9b
230 changed files with 15646 additions and 22895 deletions
26
ardour.dox
26
ardour.dox
|
|
@ -138,7 +138,7 @@ SHORT_NAMES = NO
|
|||
# comments will behave just like the Qt-style comments (thus requiring an
|
||||
# explicit @brief command for a brief description.
|
||||
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
|
||||
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
||||
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
||||
|
|
@ -202,7 +202,7 @@ OPTIMIZE_OUTPUT_JAVA = NO
|
|||
# func(std::string) {}). This also make the inheritance and collaboration
|
||||
# diagrams that involve STL classes more complete and accurate.
|
||||
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
BUILTIN_STL_SUPPORT = YES
|
||||
|
||||
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
|
||||
# tag is set to YES, then doxygen will reuse the documentation of the first
|
||||
|
|
@ -233,12 +233,12 @@ EXTRACT_ALL = YES
|
|||
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_PRIVATE = NO
|
||||
|
||||
# If the EXTRACT_STATIC tag is set to YES all static members of a file
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_STATIC = NO
|
||||
|
||||
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
|
||||
# defined locally in source files will be included in the documentation.
|
||||
|
|
@ -295,7 +295,7 @@ INTERNAL_DOCS = NO
|
|||
# in case and if your file system supports case sensitive file names. Windows
|
||||
# and Mac users are advised to set this option to NO.
|
||||
|
||||
CASE_SENSE_NAMES = YES
|
||||
CASE_SENSE_NAMES = NO
|
||||
|
||||
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
|
||||
# will show members with their full class and namespace scopes in the
|
||||
|
|
@ -342,7 +342,7 @@ SORT_BY_SCOPE_NAME = NO
|
|||
# disable (NO) the todo list. This list is created by putting \todo
|
||||
# commands in the documentation.
|
||||
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TODOLIST = NO
|
||||
|
||||
# The GENERATE_TESTLIST tag can be used to enable (YES) or
|
||||
# disable (NO) the test list. This list is created by putting \test
|
||||
|
|
@ -354,13 +354,13 @@ GENERATE_TESTLIST = NO
|
|||
# disable (NO) the bug list. This list is created by putting \bug
|
||||
# commands in the documentation.
|
||||
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_BUGLIST = NO
|
||||
|
||||
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
|
||||
# disable (NO) the deprecated list. This list is created by putting
|
||||
# \deprecated commands in the documentation.
|
||||
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
GENERATE_DEPRECATEDLIST= NO
|
||||
|
||||
# The ENABLED_SECTIONS tag can be used to enable conditional
|
||||
# documentation sections, marked by \if sectionname ... \endif.
|
||||
|
|
@ -406,19 +406,19 @@ FILE_VERSION_FILTER =
|
|||
# The QUIET tag can be used to turn on/off the messages that are generated
|
||||
# by doxygen. Possible values are YES and NO. If left blank NO is used.
|
||||
|
||||
QUIET = YES
|
||||
QUIET = NO
|
||||
|
||||
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
||||
# generated by doxygen. Possible values are YES and NO. If left blank
|
||||
# NO is used.
|
||||
|
||||
WARNINGS = NO
|
||||
WARNINGS = YES
|
||||
|
||||
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
|
||||
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
|
||||
# automatically be disabled.
|
||||
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
|
||||
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
|
||||
# potential errors in the documentation, such as not documenting some
|
||||
|
|
@ -459,7 +459,7 @@ WARN_LOGFILE =
|
|||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = libs/pbd3 libs/midi++2 libs/ardour #libs/gtkmm2ext gtk2_ardour
|
||||
INPUT = libs/pbd libs/midi++2 libs/ardour libs/gtkmm2ext gtk2_ardour
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
|
|
@ -1082,7 +1082,7 @@ CLASS_DIAGRAMS = YES
|
|||
# inheritance and usage relations if the target is undocumented
|
||||
# or is not a class.
|
||||
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
|
||||
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
|
||||
# available from the path. This tool is part of Graphviz, a graph visualization
|
||||
|
|
|
|||
|
|
@ -45,16 +45,15 @@ using namespace PBD;
|
|||
AnalysisWindow::AnalysisWindow()
|
||||
: ArdourDialog(_("analysis window")),
|
||||
|
||||
fft_graph (2048),
|
||||
|
||||
source_selection_label (_("Signal source")),
|
||||
source_selection_ranges_rb (_("Selected ranges")),
|
||||
source_selection_regions_rb (_("Selected regions")),
|
||||
|
||||
display_model_label (_("Display model")),
|
||||
display_model_composite_separate_rb (_("Composite graphs for each track")),
|
||||
display_model_composite_all_tracks_rb (_("Composite graph of all tracks"))
|
||||
display_model_composite_all_tracks_rb (_("Composite graph of all tracks")),
|
||||
|
||||
fft_graph (2048)
|
||||
{
|
||||
track_list_ready = false;
|
||||
|
||||
|
|
@ -242,7 +241,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
|
|||
if (!pl || !rui)
|
||||
continue;
|
||||
|
||||
FFTResult *res = fft_graph.prepareResult(*&rui->color(), *&rui->route().name());
|
||||
FFTResult *res = fft_graph.prepareResult(rui->color(), rui->route().name());
|
||||
|
||||
// if timeSelection
|
||||
if (source_selection_ranges_rb.get_active()) {
|
||||
|
|
@ -320,7 +319,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
|
|||
Gtk::TreeModel::Row newrow = *(tlmodel)->append();
|
||||
newrow[tlcols.trackname] = rui->route().name();
|
||||
newrow[tlcols.visible] = true;
|
||||
newrow[tlcols.color] = *&rui->color();
|
||||
newrow[tlcols.color] = rui->color();
|
||||
newrow[tlcols.graph] = res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
export ARDOUR_PATH=./glade:./pixmaps:.
|
||||
|
||||
export LD_LIBRARY_PATH=../libs/surfaces/control_protocol:../libs/ardour:../libs/midi++2:../libs/pbd3:../libs/soundtouch:../libs/gtkmm2ext:../libs/sigc++2:../libs/glibmm2:../libs/gtkmm2/atk:../libs/gtkmm2/pango:../libs/gtkmm2/gdk:../libs/gtkmm2/gtk:../libs/libgnomecanvasmm:../libs/libsndfile:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../libs/surfaces/control_protocol:../libs/ardour:../libs/midi++2:../libs/pbd:../libs/soundtouch:../libs/gtkmm2ext:../libs/sigc++2:../libs/glibmm2:../libs/gtkmm2/atk:../libs/gtkmm2/pango:../libs/gtkmm2/gdk:../libs/gtkmm2/gtk:../libs/libgnomecanvasmm:../libs/libsndfile:$LD_LIBRARY_PATH
|
||||
|
||||
# DYLD_LIBRARY_PATH is for darwin.
|
||||
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
|
|
|
|||
|
|
@ -1200,35 +1200,25 @@ ARDOUR_UI::transport_forward (int option)
|
|||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_monitor_enable (guint32 dstream)
|
||||
ARDOUR_UI::toggle_record_enable (uint32_t dstream)
|
||||
{
|
||||
if (session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Diskstream *ds;
|
||||
Route* r;
|
||||
|
||||
if ((ds = session->diskstream_by_id (dstream)) != 0) {
|
||||
AudioDiskstream *ads = dynamic_cast<AudioDiskstream*>(ds);
|
||||
if (ads) {
|
||||
Port *port = ds->io()->input (0);
|
||||
port->request_monitor_input (!port->monitoring_input());
|
||||
if ((r = session->route_by_remote_id (dstream)) != 0) {
|
||||
|
||||
AudioTrack* at;
|
||||
|
||||
if ((at = dynamic_cast<AudioTrack*>(r)) != 0) {
|
||||
at->disk_stream().set_record_enabled (!at->disk_stream().record_enabled(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_record_enable (guint32 dstream)
|
||||
{
|
||||
if (session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Diskstream *ds;
|
||||
|
||||
if ((ds = session->diskstream_by_id (dstream)) != 0) {
|
||||
ds->set_record_enabled (!ds->record_enabled(), this);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1429,63 +1419,6 @@ ARDOUR_UI::stop_blinking ()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ARDOUR_UI::add_diskstream_to_menu (Diskstream& dstream)
|
||||
{
|
||||
using namespace Gtk;
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
if (dstream.hidden()) {
|
||||
return;
|
||||
}
|
||||
|
||||
MenuList& items = diskstream_menu->items();
|
||||
items.push_back (MenuElem (dstream.name(), bind (mem_fun(*this, &ARDOUR_UI::diskstream_selected), (gint32) dstream.id())));
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::diskstream_selected (gint32 id)
|
||||
{
|
||||
selected_dstream = id;
|
||||
Main::quit ();
|
||||
}
|
||||
|
||||
gint32
|
||||
ARDOUR_UI::select_diskstream (GdkEventButton *ev)
|
||||
{
|
||||
using namespace Gtk;
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
if (session == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
diskstream_menu = new Menu();
|
||||
diskstream_menu->set_name ("ArdourContextMenu");
|
||||
using namespace Gtk;
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
MenuList& items = diskstream_menu->items();
|
||||
items.push_back (MenuElem (_("No Stream"), (bind (mem_fun(*this, &ARDOUR_UI::diskstream_selected), -1))));
|
||||
|
||||
session->foreach_diskstream (this, &ARDOUR_UI::add_diskstream_to_menu);
|
||||
|
||||
if (ev) {
|
||||
diskstream_menu->popup (ev->button, ev->time);
|
||||
} else {
|
||||
diskstream_menu->popup (0, 0);
|
||||
}
|
||||
|
||||
selected_dstream = -1;
|
||||
|
||||
Main::run ();
|
||||
|
||||
delete diskstream_menu;
|
||||
|
||||
return selected_dstream;
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::name_io_setup (AudioEngine& engine,
|
||||
string& buf,
|
||||
|
|
|
|||
|
|
@ -154,8 +154,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
void toggle_tempo_window ();
|
||||
void toggle_editing_space();
|
||||
|
||||
gint32 select_diskstream (GdkEventButton *ev);
|
||||
|
||||
Gtk::Tooltips& tooltips() { return _tooltips; }
|
||||
|
||||
static sigc::signal<void,bool> Blink;
|
||||
|
|
@ -542,15 +540,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
|
||||
void save_template ();
|
||||
|
||||
|
||||
void session_add_audio_route (bool disk, int32_t input_channels, int32_t output_channels, ARDOUR::TrackMode mode);
|
||||
void session_add_midi_route (bool disk);
|
||||
|
||||
void add_diskstream_to_menu (ARDOUR::Diskstream&);
|
||||
void diskstream_selected (gint32);
|
||||
Gtk::Menu *diskstream_menu;
|
||||
gint32 selected_dstream;
|
||||
|
||||
void set_transport_sensitivity (bool);
|
||||
|
||||
void remove_last_capture ();
|
||||
|
|
@ -633,8 +625,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
void test_binding_action (const char *);
|
||||
void start_keyboard_prefix();
|
||||
|
||||
void toggle_record_enable (guint32);
|
||||
void toggle_monitor_enable (guint32);
|
||||
void toggle_record_enable (uint32_t);
|
||||
|
||||
uint32_t rec_enabled_diskstreams;
|
||||
void count_recenabled_diskstreams (ARDOUR::Diskstream&);
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
#include <pbd/stl_delete.h>
|
||||
#include <pbd/whitespace.h>
|
||||
|
||||
#include <gtkmm2ext/bindable_button.h>
|
||||
#include <gtkmm2ext/gtk_ui.h>
|
||||
#include <gtkmm2ext/selector.h>
|
||||
#include <gtkmm2ext/stop_signal.h>
|
||||
#include <gtkmm2ext/bindable_button.h>
|
||||
#include <gtkmm2ext/utils.h>
|
||||
|
||||
#include <ardour/audioplaylist.h>
|
||||
|
|
@ -120,11 +120,9 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
|
|||
|
||||
ignore_toggle = false;
|
||||
|
||||
rec_enable_button->set_active (false);
|
||||
mute_button->set_active (false);
|
||||
solo_button->set_active (false);
|
||||
|
||||
rec_enable_button->set_name ("TrackRecordEnableButton");
|
||||
mute_button->set_name ("TrackMuteButton");
|
||||
solo_button->set_name ("SoloButton");
|
||||
edit_group_button.set_name ("TrackGroupButton");
|
||||
|
|
@ -138,7 +136,6 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
|
|||
|
||||
solo_button->signal_button_press_event().connect (mem_fun (*this, &AudioTimeAxisView::select_me), false);
|
||||
mute_button->signal_button_press_event().connect (mem_fun (*this, &AudioTimeAxisView::select_me), false);
|
||||
rec_enable_button->signal_button_press_event().connect (mem_fun (*this, &AudioTimeAxisView::select_me), false);
|
||||
playlist_button.signal_button_press_event().connect (mem_fun (*this, &AudioTimeAxisView::select_me), false);
|
||||
automation_button.signal_button_press_event().connect (mem_fun (*this, &AudioTimeAxisView::select_me), false);
|
||||
size_button.signal_button_press_event().connect (mem_fun (*this, &AudioTimeAxisView::select_me), false);
|
||||
|
|
@ -149,7 +146,6 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
|
|||
solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release), false);
|
||||
mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press), false);
|
||||
mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release), false);
|
||||
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
|
||||
edit_group_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::edit_click), false);
|
||||
playlist_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::playlist_click));
|
||||
automation_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::automation_click));
|
||||
|
|
@ -164,14 +160,19 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
|
|||
controls_ebox.set_name ("MidiTimeAxisViewControlsBaseUnselected");
|
||||
|
||||
if (is_audio_track()) {
|
||||
rec_enable_button->set_active (false);
|
||||
rec_enable_button->set_name ("TrackRecordEnableButton");
|
||||
rec_enable_button->signal_button_press_event().connect (mem_fun (*this, &AudioTimeAxisView::select_me), false);
|
||||
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
|
||||
controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||
ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
|
||||
}
|
||||
|
||||
controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||
controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||
|
||||
controls_table.attach (edit_group_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||
|
||||
ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip(*solo_button,_("Solo"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip(*mute_button,_("Mute"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip(edit_group_button,_("Edit Group"));
|
||||
|
|
@ -1890,7 +1891,6 @@ AudioTimeAxisView::map_frozen ()
|
|||
|
||||
ENSURE_GUI_THREAD (mem_fun(*this, &AudioTimeAxisView::map_frozen));
|
||||
|
||||
|
||||
switch (audio_track()->freeze_state()) {
|
||||
case AudioTrack::Frozen:
|
||||
playlist_button.set_sensitive (false);
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ AutomationTimeAxisView::set_height (TrackHeight ht)
|
|||
TimeAxisView* state_parent = get_parent_with_state ();
|
||||
XMLNode* xml_node = state_parent->get_child_xml_node (_state_name);
|
||||
|
||||
controls_table.show_all ();
|
||||
//controls_table.show_all ();
|
||||
|
||||
TimeAxisView::set_height (ht);
|
||||
base_rect->property_y2() = h;
|
||||
|
|
@ -297,7 +297,7 @@ AutomationTimeAxisView::set_height (TrackHeight ht)
|
|||
(*i)->set_height ();
|
||||
}
|
||||
|
||||
switch (height) {
|
||||
switch (ht) {
|
||||
case Largest:
|
||||
xml_node->add_property ("track_height", "largest");
|
||||
controls_table.remove (name_hbox);
|
||||
|
|
@ -313,6 +313,7 @@ AutomationTimeAxisView::set_height (TrackHeight ht)
|
|||
controls_table.attach (name_hbox, 1, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
}
|
||||
controls_table.show_all ();
|
||||
|
||||
hide_name_entry ();
|
||||
show_name_label ();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -41,14 +41,14 @@ class AutomationTimeAxisView : public TimeAxisView {
|
|||
|
||||
~AutomationTimeAxisView();
|
||||
|
||||
void set_height (TimeAxisView::TrackHeight);
|
||||
virtual void set_height (TimeAxisView::TrackHeight);
|
||||
void set_samples_per_unit (double);
|
||||
std::string name() const { return _name; }
|
||||
|
||||
virtual void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, jack_nframes_t, double) = 0;
|
||||
|
||||
void clear_lines ();
|
||||
void add_line (AutomationLine&);
|
||||
virtual void clear_lines ();
|
||||
virtual void add_line (AutomationLine&);
|
||||
|
||||
vector<AutomationLine*> lines;
|
||||
|
||||
|
|
|
|||
|
|
@ -2146,7 +2146,6 @@ Editor::set_state (const XMLNode& node)
|
|||
yoff = atoi(geometry->property("y_off")->value());
|
||||
}
|
||||
|
||||
set_geometry_hints (vpacker, g, Gdk::HINT_BASE_SIZE);
|
||||
set_default_size (g.base_width, g.base_height);
|
||||
move (x, y);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#include <gtkmm2ext/click_box.h>
|
||||
#include <gtkmm2ext/dndtreeview.h>
|
||||
|
||||
#include <ardour/stateful.h>
|
||||
#include <pbd/stateful.h>
|
||||
#include <ardour/session.h>
|
||||
#include <ardour/tempo.h>
|
||||
#include <ardour/location.h>
|
||||
|
|
|
|||
|
|
@ -2088,7 +2088,14 @@ Editor::marker_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
move_both = true;
|
||||
}
|
||||
|
||||
if (is_start) { // start marker
|
||||
if (copy_location->is_mark()) {
|
||||
/* just move it */
|
||||
|
||||
copy_location->set_start (newframe);
|
||||
|
||||
} else {
|
||||
|
||||
if (is_start) { // start-of-range marker
|
||||
|
||||
if (move_both) {
|
||||
copy_location->set_start (newframe);
|
||||
|
|
@ -2115,6 +2122,7 @@ Editor::marker_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
copy_location->set_end (newframe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
drag_info.last_pointer_frame = drag_info.current_pointer_frame;
|
||||
drag_info.first_move = false;
|
||||
|
|
@ -2145,8 +2153,12 @@ Editor::marker_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
|
|||
Location * location = find_location_from_marker (marker, is_start);
|
||||
|
||||
if (location) {
|
||||
if (location->is_mark()) {
|
||||
location->set_start (drag_info.copied_location->start());
|
||||
} else {
|
||||
location->set (drag_info.copied_location->start(), drag_info.copied_location->end());
|
||||
}
|
||||
}
|
||||
|
||||
session->add_redo_no_execute( session->locations()->get_memento() );
|
||||
commit_reversible_command ();
|
||||
|
|
|
|||
|
|
@ -263,6 +263,10 @@ Editor::redisplay_route_list ()
|
|||
|
||||
}
|
||||
|
||||
/* make sure the cursors stay on top of every newly added track */
|
||||
|
||||
cursor_group->raise_to_top ();
|
||||
|
||||
reset_scrolling_region ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -234,11 +234,11 @@ FFTGraph::draw_scales(Glib::RefPtr<Gdk::Window> window)
|
|||
while (_logScale[logscale_pos] < position_on_scale)
|
||||
logscale_pos++;
|
||||
|
||||
int coord = (int)(v_margin + 1.0 + position_on_scale);
|
||||
int coord = v_margin + 1.0 + position_on_scale;
|
||||
|
||||
int SR = 44100;
|
||||
|
||||
int rate_at_pos = (int)((double)(SR/2) * (double)logscale_pos / (double)_dataSize);
|
||||
int rate_at_pos = (double)(SR/2) * (double)logscale_pos / (double)_dataSize;
|
||||
|
||||
char buf[32];
|
||||
snprintf(buf,32,"%dhz",rate_at_pos);
|
||||
|
|
@ -384,7 +384,7 @@ FFTGraph::on_size_request(Gtk::Requisition* requisition)
|
|||
}
|
||||
|
||||
void
|
||||
FFTGraph::on_size_allocate(Gtk::Allocation& alloc)
|
||||
FFTGraph::on_size_allocate(Gtk::Allocation & alloc)
|
||||
{
|
||||
width = alloc.get_width();
|
||||
height = alloc.get_height();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class FFTGraph : public Gtk::DrawingArea
|
|||
bool on_expose_event (GdkEventExpose* event);
|
||||
|
||||
void on_size_request(Gtk::Requisition* requisition);
|
||||
void on_size_allocate(Gtk::Allocation& alloc);
|
||||
void on_size_allocate(Gtk::Allocation & alloc);
|
||||
FFTResult *prepareResult(Gdk::Color color, std::string trackname);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -99,18 +99,13 @@ GainMeter::GainMeter (IO& io, Session& s)
|
|||
|
||||
gain_slider = manage (new VSliderController (slider, rail,
|
||||
&gain_adjustment,
|
||||
& _io.midi_gain_control(),
|
||||
_io.gain_control(),
|
||||
false));
|
||||
|
||||
gain_slider->signal_button_press_event().connect (mem_fun(*this, &GainMeter::start_gain_touch));
|
||||
gain_slider->signal_button_release_event().connect (mem_fun(*this, &GainMeter::end_gain_touch));
|
||||
gain_slider->set_name ("MixerGainMeter");
|
||||
|
||||
if (_session.midi_port()) {
|
||||
_io.set_midi_to_gain_function (slider_position_to_gain);
|
||||
_io.set_gain_to_midi_function (gain_to_slider_position);
|
||||
}
|
||||
|
||||
gain_display.set_print_func (_gain_printer, this);
|
||||
|
||||
gain_display_box.set_spacing (2);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
|
||||
#include <ardour/types.h>
|
||||
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
#include <gtkmm2ext/click_box.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
|
||||
#include "enums.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
#include <ardour/types.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include "selection.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@
|
|||
#include <gtkmm2ext/gtk_ui.h>
|
||||
#include <gtkmm2ext/utils.h>
|
||||
#include <gtkmm2ext/choice.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
#include <gtkmm2ext/stop_signal.h>
|
||||
#include <gtkmm2ext/bindable_button.h>
|
||||
#include <gtkmm2ext/doi.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
#include <gtkmm2ext/bindable_button.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/session.h>
|
||||
|
|
@ -52,7 +52,6 @@
|
|||
#include "keyboard.h"
|
||||
#include "plugin_selector.h"
|
||||
#include "public_editor.h"
|
||||
|
||||
#include "plugin_ui.h"
|
||||
#include "send_ui.h"
|
||||
#include "io_selector.h"
|
||||
|
|
@ -159,9 +158,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
|
|||
/* XXX what is this meant to do? */
|
||||
//meter_point_button.signal_button_release_event().connect (mem_fun (gpm, &GainMeter::meter_release), false);
|
||||
|
||||
rec_enable_button->set_name ("MixerRecordEnableButton");
|
||||
rec_enable_button->unset_flags (Gtk::CAN_FOCUS);
|
||||
|
||||
solo_button->set_name ("MixerSoloButton");
|
||||
mute_button->set_name ("MixerMuteButton");
|
||||
|
||||
|
|
@ -191,6 +187,10 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
|
|||
|
||||
if (is_audio_track()) {
|
||||
|
||||
rec_enable_button->set_name ("MixerRecordEnableButton");
|
||||
rec_enable_button->unset_flags (Gtk::CAN_FOCUS);
|
||||
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
|
||||
|
||||
AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
|
||||
|
||||
at->FreezeChange.connect (mem_fun(*this, &MixerStrip::map_frozen));
|
||||
|
|
@ -301,7 +301,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
|
|||
input_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::input_press), false);
|
||||
output_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::output_press), false);
|
||||
|
||||
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
|
||||
solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press), false);
|
||||
solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release), false);
|
||||
mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press), false);
|
||||
|
|
@ -414,7 +413,9 @@ MixerStrip::set_width (Width w)
|
|||
set_size_request (-1, -1);
|
||||
xml_node->add_property ("strip_width", "wide");
|
||||
|
||||
if (rec_enable_button) {
|
||||
rec_enable_button->set_label (_("record"));
|
||||
}
|
||||
mute_button->set_label (_("mute"));
|
||||
solo_button->set_label (_("solo"));
|
||||
|
||||
|
|
@ -435,7 +436,9 @@ MixerStrip::set_width (Width w)
|
|||
set_size_request (50, -1);
|
||||
xml_node->add_property ("strip_width", "narrow");
|
||||
|
||||
if (rec_enable_button) {
|
||||
rec_enable_button->set_label (_("Rec"));
|
||||
}
|
||||
mute_button->set_label (_("M"));
|
||||
solo_button->set_label (_("S"));
|
||||
|
||||
|
|
@ -1212,7 +1215,9 @@ void
|
|||
MixerStrip::engine_stopped ()
|
||||
{
|
||||
input_button.set_sensitive (false);
|
||||
if (rec_enable_button) {
|
||||
rec_enable_button->set_sensitive (false);
|
||||
}
|
||||
output_button.set_sensitive (false);
|
||||
}
|
||||
|
||||
|
|
@ -1220,7 +1225,9 @@ void
|
|||
MixerStrip::engine_running ()
|
||||
{
|
||||
input_button.set_sensitive (true);
|
||||
if (rec_enable_button) {
|
||||
rec_enable_button->set_sensitive (true);
|
||||
}
|
||||
output_button.set_sensitive (true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,14 +37,15 @@
|
|||
#include <gtkmm/adjustment.h>
|
||||
|
||||
#include <gtkmm2ext/auto_spin.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
#include <gtkmm2ext/click_box.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/types.h>
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/io.h>
|
||||
#include <ardour/insert.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/redirect.h>
|
||||
|
||||
#include <pbd/fastlog.h>
|
||||
|
|
|
|||
|
|
@ -33,8 +33,9 @@
|
|||
#include <gtkmm/menu.h>
|
||||
#include <gtkmm/treeview.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/io.h>
|
||||
|
||||
#include "keyboard_target.h"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ PanAutomationTimeAxisView::PanAutomationTimeAxisView (Session& s, Route& r, Publ
|
|||
: AxisView (s),
|
||||
AutomationTimeAxisView (s, r, e, parent, canvas, n, X_("pan"), "")
|
||||
{
|
||||
multiline_selector.set_name ("PanAutomationLineSelector");
|
||||
|
||||
controls_table.attach (multiline_selector, 1, 5, 1, 2, Gtk::FILL | Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
}
|
||||
|
||||
PanAutomationTimeAxisView::~PanAutomationTimeAxisView ()
|
||||
|
|
@ -53,15 +56,20 @@ PanAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEv
|
|||
return;
|
||||
}
|
||||
|
||||
if (lines.size() > 1) {
|
||||
int line_index = 0;
|
||||
|
||||
if (lines.size() > 1) {
|
||||
line_index = multiline_selector.get_active_row_number();
|
||||
|
||||
if (line_index < 0 || line_index >= (int)lines.size()) {
|
||||
Gtkmm2ext::PopUp* msg = new Gtkmm2ext::PopUp (Gtk::WIN_POS_MOUSE, 5000, true);
|
||||
|
||||
msg->set_text (_("You can't graphically edit panning of more than stream"));
|
||||
msg->set_text (_("You need to select which line to edit"));
|
||||
msg->touch ();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
double x = 0;
|
||||
|
||||
|
|
@ -75,16 +83,59 @@ PanAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEv
|
|||
|
||||
lines.front()->view_to_model_y (y);
|
||||
|
||||
AutomationList& alist (lines.front()->the_list());
|
||||
AutomationList& alist (lines[line_index]->the_list());
|
||||
|
||||
_session.begin_reversible_command (_("add pan automation event"));
|
||||
_session.add_undo (alist.get_memento());
|
||||
alist.add (when, y);
|
||||
_session.add_undo (alist.get_memento());
|
||||
_session.add_redo_no_execute (alist.get_memento());
|
||||
_session.commit_reversible_command ();
|
||||
_session.set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
PanAutomationTimeAxisView::clear_lines ()
|
||||
{
|
||||
AutomationTimeAxisView::clear_lines();
|
||||
multiline_selector.clear();
|
||||
}
|
||||
|
||||
void
|
||||
PanAutomationTimeAxisView::add_line (AutomationLine& line)
|
||||
{
|
||||
char buf[32];
|
||||
snprintf(buf,32,"Line %d",lines.size()+1);
|
||||
multiline_selector.append_text(buf);
|
||||
|
||||
if (lines.empty()) {
|
||||
multiline_selector.set_active(0);
|
||||
}
|
||||
|
||||
if (lines.size() + 1 > 1) {
|
||||
multiline_selector.show();
|
||||
}
|
||||
|
||||
AutomationTimeAxisView::add_line(line);
|
||||
}
|
||||
|
||||
void
|
||||
PanAutomationTimeAxisView::set_height (TimeAxisView::TrackHeight th)
|
||||
{
|
||||
AutomationTimeAxisView::set_height(th);
|
||||
|
||||
switch (th) {
|
||||
case Largest:
|
||||
case Large:
|
||||
case Larger:
|
||||
case Normal:
|
||||
multiline_selector.show();
|
||||
break;
|
||||
|
||||
default:
|
||||
multiline_selector.hide();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PanAutomationTimeAxisView::set_automation_state (AutoState state)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
#include "canvas.h"
|
||||
#include "automation_time_axis.h"
|
||||
|
||||
#include <gtkmm/comboboxtext.h>
|
||||
|
||||
namespace ARDOUR {
|
||||
class Redirect;
|
||||
}
|
||||
|
|
@ -22,6 +24,13 @@ class PanAutomationTimeAxisView : public AutomationTimeAxisView
|
|||
|
||||
void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, jack_nframes_t, double);
|
||||
|
||||
void clear_lines ();
|
||||
void add_line (AutomationLine&);
|
||||
void set_height (TimeAxisView::TrackHeight);
|
||||
|
||||
protected:
|
||||
Gtk::ComboBoxText multiline_selector;
|
||||
|
||||
private:
|
||||
void automation_changed ();
|
||||
void set_automation_state (ARDOUR::AutoState);
|
||||
|
|
|
|||
|
|
@ -316,13 +316,9 @@ PannerUI::setup_pan ()
|
|||
_io.panner()[asz]->Changed.connect (bind (mem_fun(*this, &PannerUI::pan_value_changed), (uint32_t) asz));
|
||||
|
||||
bc = new BarController (*pan_adjustments[asz],
|
||||
&_io.panner()[asz]->midi_control(),
|
||||
_io.panner()[asz]->control(),
|
||||
bind (mem_fun(*this, &PannerUI::pan_printer), pan_adjustments[asz]));
|
||||
|
||||
if (_session.midi_port()) {
|
||||
_io.panner()[asz]->reset_midi_control (_session.midi_port(), true);
|
||||
}
|
||||
|
||||
bc->set_name ("PanSlider");
|
||||
bc->set_shadow_type (Gtk::SHADOW_NONE);
|
||||
bc->set_style (BarController::Line);
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
#include <gtkmm/togglebutton.h>
|
||||
#include <gtkmm/button.h>
|
||||
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
#include <gtkmm2ext/click_box.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
|
||||
#include "enums.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ PlaylistSelector::add_playlist_to_map (Playlist *pl)
|
|||
|
||||
if ((x = dspl_map.find (apl->get_orig_diskstream_id())) == dspl_map.end()) {
|
||||
|
||||
pair<ARDOUR::id_t,list<Playlist*>*> newp (apl->get_orig_diskstream_id(), new list<Playlist*>);
|
||||
pair<PBD::ID,list<Playlist*>*> newp (apl->get_orig_diskstream_id(), new list<Playlist*>);
|
||||
|
||||
x = dspl_map.insert (dspl_map.end(), newp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class PlaylistSelector : public ArdourDialog
|
|||
void show_for (RouteUI*);
|
||||
|
||||
private:
|
||||
typedef std::map<ARDOUR::id_t,std::list<ARDOUR::Playlist*>*> DSPL_Map;
|
||||
typedef std::map<PBD::ID,std::list<ARDOUR::Playlist*>*> DSPL_Map;
|
||||
|
||||
ARDOUR::Session* session;
|
||||
Gtk::ScrolledWindow scroller;
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@
|
|||
|
||||
#include <gtkmm2ext/click_box.h>
|
||||
#include <gtkmm2ext/fastmeter.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
#include <gtkmm2ext/barcontroller.h>
|
||||
#include <gtkmm2ext/utils.h>
|
||||
#include <gtkmm2ext/doi.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
|
||||
#include <midi++/manager.h>
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ PluginUI::build (AudioEngine &engine)
|
|||
}
|
||||
}
|
||||
|
||||
if ((cui = build_control_ui (engine, i, plugin.get_nth_midi_control (i))) == 0) {
|
||||
if ((cui = build_control_ui (engine, i, plugin.get_nth_control (i))) == 0) {
|
||||
error << string_compose(_("Plugin Editor: could not build control element for port %1"), i) << endmsg;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -419,7 +419,7 @@ PluginUI::print_parameter (char *buf, uint32_t len, uint32_t param)
|
|||
}
|
||||
|
||||
PluginUI::ControlUI*
|
||||
PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, MIDI::Controllable* mcontrol)
|
||||
PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, PBD::Controllable* mcontrol)
|
||||
|
||||
{
|
||||
ControlUI* control_ui;
|
||||
|
|
@ -516,7 +516,7 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, MIDI::Contr
|
|||
} else {
|
||||
sigc::slot<void,char*,uint32_t> pslot = sigc::bind (mem_fun(*this, &PluginUI::print_parameter), (uint32_t) port_index);
|
||||
|
||||
control_ui->control = new BarController (*control_ui->adjustment, mcontrol, pslot);
|
||||
control_ui->control = new BarController (*control_ui->adjustment, *mcontrol, pslot);
|
||||
// should really match the height of the text in the automation button+label
|
||||
control_ui->control->set_size_request (200, 22);
|
||||
control_ui->control->set_name (X_("PluginSlider"));
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace ARDOUR {
|
|||
class Redirect;
|
||||
}
|
||||
|
||||
namespace MIDI {
|
||||
namespace PBD {
|
||||
class Controllable;
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
|
|||
void output_update();
|
||||
|
||||
void build (ARDOUR::AudioEngine &);
|
||||
ControlUI* build_control_ui (ARDOUR::AudioEngine &, guint32 port_index, MIDI::Controllable *);
|
||||
ControlUI* build_control_ui (ARDOUR::AudioEngine &, guint32 port_index, PBD::Controllable *);
|
||||
std::vector<string> setup_scale_values(guint32 port_index, ControlUI* cui);
|
||||
void control_adjustment_changed (ControlUI* cui);
|
||||
void parameter_changed (uint32_t, float, ControlUI* cui);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -33,11 +33,12 @@
|
|||
#include <gtkmm2ext/click_box.h>
|
||||
#include <gtkmm2ext/dndtreeview.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/types.h>
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/io.h>
|
||||
#include <ardour/insert.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/redirect.h>
|
||||
|
||||
#include <pbd/fastlog.h>
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ AudioRegionView::set_height (gdouble height)
|
|||
for (uint32_t n=0; n < wcnt; ++n) {
|
||||
gdouble ht;
|
||||
|
||||
if ((height) < NAME_HIGHLIGHT_THRESH) {
|
||||
if ((height) <= NAME_HIGHLIGHT_THRESH) {
|
||||
ht = ((height-2*wcnt) / (double) wcnt);
|
||||
} else {
|
||||
ht = (((height-2*wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
|
||||
|
|
|
|||
|
|
@ -33,8 +33,9 @@
|
|||
#include <gtkmm/togglebutton.h>
|
||||
#include <gtkmm/treeview.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/io.h>
|
||||
#include <ardour/redirect.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
#include <gtkmm2ext/gtk_ui.h>
|
||||
#include <gtkmm2ext/stop_signal.h>
|
||||
#include <gtkmm2ext/choice.h>
|
||||
#include <gtkmm2ext/bindable_button.h>
|
||||
#include <gtkmm2ext/doi.h>
|
||||
#include <gtkmm2ext/bindable_button.h>
|
||||
|
||||
#include <ardour/route_group.h>
|
||||
|
||||
|
|
@ -69,10 +69,8 @@ RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name,
|
|||
_route.GoingAway.connect (mem_fun (*this, &RouteUI::route_removed));
|
||||
_route.active_changed.connect (mem_fun (*this, &RouteUI::route_active_changed));
|
||||
|
||||
mute_button = manage (new BindableToggleButton (& _route.midi_mute_control(), m_name ));
|
||||
mute_button->set_bind_button_state (2, GDK_CONTROL_MASK);
|
||||
solo_button = manage (new BindableToggleButton (& _route.midi_solo_control(), s_name ));
|
||||
solo_button->set_bind_button_state (2, GDK_CONTROL_MASK);
|
||||
mute_button = manage (new BindableToggleButton (_route.mute_control(), m_name ));
|
||||
solo_button = manage (new BindableToggleButton (_route.solo_control(), s_name ));
|
||||
|
||||
if (is_audio_track()) {
|
||||
AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
|
||||
|
|
@ -81,20 +79,18 @@ RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name,
|
|||
|
||||
_session.RecordStateChanged.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
|
||||
|
||||
rec_enable_button = manage (new BindableToggleButton (& at->midi_rec_enable_control(), r_name ));
|
||||
rec_enable_button->set_bind_button_state (2, GDK_CONTROL_MASK);
|
||||
rec_enable_button = manage (new BindableToggleButton (at->rec_enable_control(), r_name ));
|
||||
|
||||
} else {
|
||||
rec_enable_button = manage (new BindableToggleButton (0, r_name ));
|
||||
rec_enable_button->unset_flags (Gtk::CAN_FOCUS);
|
||||
|
||||
update_rec_display ();
|
||||
}
|
||||
|
||||
mute_button->unset_flags (Gtk::CAN_FOCUS);
|
||||
solo_button->unset_flags (Gtk::CAN_FOCUS);
|
||||
rec_enable_button->unset_flags (Gtk::CAN_FOCUS);
|
||||
|
||||
/* map the current state */
|
||||
|
||||
update_rec_display ();
|
||||
map_frozen ();
|
||||
}
|
||||
|
||||
|
|
@ -274,7 +270,7 @@ RouteUI::solo_release(GdkEventButton* ev)
|
|||
gint
|
||||
RouteUI::rec_enable_press(GdkEventButton* ev)
|
||||
{
|
||||
if (!ignore_toggle && is_audio_track()) {
|
||||
if (!ignore_toggle && is_audio_track() && rec_enable_button) {
|
||||
|
||||
if (ev->button == 2 && Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
|
||||
// do nothing on midi bind event
|
||||
|
|
@ -486,7 +482,7 @@ RouteUI::build_solo_menu (void)
|
|||
check->show_all();
|
||||
|
||||
items.push_back (SeparatorElem());
|
||||
items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
|
||||
// items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -529,7 +525,7 @@ RouteUI::build_mute_menu(void)
|
|||
check->show_all();
|
||||
|
||||
items.push_back (SeparatorElem());
|
||||
items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
|
||||
// items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -29,10 +29,6 @@
|
|||
|
||||
#include "axis_view.h"
|
||||
|
||||
namespace Gtkmm2ext {
|
||||
class BindableToggleButton;
|
||||
}
|
||||
|
||||
namespace ARDOUR {
|
||||
class AudioTrack;
|
||||
class MidiTrack;
|
||||
|
|
@ -44,6 +40,8 @@ namespace Gtk {
|
|||
class Widget;
|
||||
}
|
||||
|
||||
class BindableToggleButton;
|
||||
|
||||
class RouteUI : public virtual AxisView
|
||||
{
|
||||
public:
|
||||
|
|
@ -69,9 +67,9 @@ class RouteUI : public virtual AxisView
|
|||
bool ignore_toggle;
|
||||
bool wait_for_release;
|
||||
|
||||
Gtkmm2ext::BindableToggleButton * mute_button;
|
||||
Gtkmm2ext::BindableToggleButton * solo_button;
|
||||
Gtkmm2ext::BindableToggleButton * rec_enable_button;
|
||||
BindableToggleButton* mute_button;
|
||||
BindableToggleButton* solo_button;
|
||||
BindableToggleButton* rec_enable_button;
|
||||
|
||||
virtual string solo_button_name () const { return "SoloButton"; }
|
||||
virtual string safe_solo_button_name () const { return "SafeSoloButton"; }
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Selectable : public virtual sigc::trackable
|
|||
|
||||
virtual void set_selected (bool yn) {
|
||||
if (yn != _selected) {
|
||||
_selected = true;
|
||||
_selected = yn;
|
||||
Selected (_selected); /* EMIT_SIGNAL */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,16 +42,19 @@ using namespace PBD;
|
|||
using namespace Editing;
|
||||
using namespace ArdourCanvas;
|
||||
|
||||
const TimeAxisViewItem::Visibility TapeAudioRegionView::default_tape_visibility = TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameHighlight|
|
||||
TimeAxisViewItem::ShowFrame|
|
||||
TimeAxisViewItem::HideFrameRight|
|
||||
TimeAxisViewItem::FullWidthNameHighlight);
|
||||
|
||||
TapeAudioRegionView::TapeAudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView &tv,
|
||||
AudioRegion& r,
|
||||
double spu,
|
||||
Gdk::Color& basic_color)
|
||||
|
||||
: AudioRegionView (parent, tv, r, spu, basic_color,
|
||||
TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameHighlight|
|
||||
TimeAxisViewItem::ShowFrame|
|
||||
TimeAxisViewItem::HideFrameLR|
|
||||
TimeAxisViewItem::FullWidthNameHighlight))
|
||||
TimeAxisViewItem::Visibility ((r.position() != 0) ? default_tape_visibility :
|
||||
TimeAxisViewItem::Visibility (default_tape_visibility|TimeAxisViewItem::HideFrameLeft)))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ class TapeAudioRegionView : public AudioRegionView
|
|||
|
||||
void set_frame_color ();
|
||||
void update (uint32_t n);
|
||||
|
||||
static const TimeAxisViewItem::Visibility default_tape_visibility;
|
||||
};
|
||||
|
||||
#endif /* __gtk_ardour_tape_audio_region_view_h__ */
|
||||
|
|
|
|||
|
|
@ -661,8 +661,6 @@ TimeAxisView::show_selection (TimeSelection& ts)
|
|||
void
|
||||
TimeAxisView::reshow_selection (TimeSelection& ts)
|
||||
{
|
||||
cerr << name() << ": reshow selection" << endl;
|
||||
|
||||
show_selection (ts);
|
||||
|
||||
for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
|
||||
|
|
@ -882,7 +880,7 @@ TimeAxisView::reset_height()
|
|||
set_height_pixels (height);
|
||||
|
||||
for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
|
||||
(*i)->set_height ((TrackHeight)(*i)->height);
|
||||
(*i)->set_height_pixels ((TrackHeight)(*i)->height);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,8 +137,12 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
|
|||
|
||||
uint32_t outline_what = 0x1|0x2|0x4|0x8;
|
||||
|
||||
if (visibility & HideFrameLR) {
|
||||
outline_what &= ~(0x1 | 0x2);
|
||||
if (visibility & HideFrameLeft) {
|
||||
outline_what &= ~(0x1);
|
||||
}
|
||||
|
||||
if (visibility & HideFrameRight) {
|
||||
outline_what &= ~(0x2);
|
||||
}
|
||||
|
||||
if (visibility & HideFrameTB) {
|
||||
|
|
|
|||
|
|
@ -316,9 +316,10 @@ class TimeAxisViewItem : public Selectable
|
|||
ShowNameHighlight = 0x2,
|
||||
ShowNameText = 0x4,
|
||||
ShowHandles = 0x8,
|
||||
HideFrameLR = 0x10,
|
||||
HideFrameTB = 0x20,
|
||||
FullWidthNameHighlight = 0x40
|
||||
HideFrameLeft = 0x10,
|
||||
HideFrameRight = 0x20,
|
||||
HideFrameTB = 0x40,
|
||||
FullWidthNameHighlight = 0x80
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ sndfile_helpers.cc
|
|||
sndfilesource.cc
|
||||
source.cc
|
||||
state_manager.cc
|
||||
stateful.cc
|
||||
tempo.cc
|
||||
utils.cc
|
||||
version.cc
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ namespace ARDOUR {
|
|||
|
||||
const layer_t max_layer = UCHAR_MAX;
|
||||
|
||||
id_t new_id();
|
||||
microseconds_t get_microseconds ();
|
||||
|
||||
Change new_change ();
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include <pbd/fastlog.h>
|
||||
#include <pbd/ringbufferNPT.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/configuration.h>
|
||||
|
|
@ -44,6 +44,7 @@
|
|||
#include <ardour/utils.h>
|
||||
#include <ardour/diskstream.h>
|
||||
#include <ardour/audioplaylist.h>
|
||||
|
||||
struct tm;
|
||||
|
||||
namespace ARDOUR {
|
||||
|
|
@ -160,6 +161,17 @@ class AudioDiskstream : public Diskstream
|
|||
//static sigc::signal<void,AudioDiskstream*> AudioDiskstreamCreated; // XXX use a ref with sigc2
|
||||
static sigc::signal<void,list<AudioFileSource*>*> DeleteSources;
|
||||
|
||||
int set_loop (Location *loc);
|
||||
sigc::signal<void,Location *> LoopSet;
|
||||
|
||||
std::list<Region*>& last_capture_regions () {
|
||||
return _last_capture_regions;
|
||||
}
|
||||
|
||||
void handle_input_change (IOChange, void *src);
|
||||
|
||||
const PBD::ID& id() const { return _id; }
|
||||
|
||||
protected:
|
||||
friend class Session;
|
||||
|
||||
|
|
@ -285,9 +297,10 @@ class AudioDiskstream : public Diskstream
|
|||
void setup_destructive_playlist ();
|
||||
void use_destructive_playlist ();
|
||||
|
||||
|
||||
ChannelList channels;
|
||||
AudioPlaylist* _playlist;
|
||||
void engage_record_enable (void* src);
|
||||
void disengage_record_enable (void* src);
|
||||
};
|
||||
|
||||
}; /* namespace ARDOUR */
|
||||
|
|
|
|||
|
|
@ -28,18 +28,23 @@
|
|||
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
using std::vector;
|
||||
using std::string;
|
||||
using std::map;
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
class AudioLibrary
|
||||
class AudioLibrary : public Stateful
|
||||
{
|
||||
public:
|
||||
AudioLibrary ();
|
||||
~AudioLibrary ();
|
||||
|
||||
XMLNode& get_state (void);
|
||||
int set_state (const XMLNode&);
|
||||
|
||||
void set_paths (vector<string> paths);
|
||||
vector<string> get_paths ();
|
||||
void scan_paths ();
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class AudioTrack : public Route
|
|||
AudioDiskstream& disk_stream() const { return *_diskstream; }
|
||||
int set_diskstream (AudioDiskstream&, void *);
|
||||
int use_diskstream (string name);
|
||||
int use_diskstream (id_t id);
|
||||
int use_diskstream (const PBD::ID& id);
|
||||
|
||||
TrackMode mode() const { return _mode; }
|
||||
void set_mode (TrackMode m);
|
||||
|
|
@ -88,13 +88,10 @@ class AudioTrack : public Route
|
|||
XMLNode& get_template();
|
||||
int set_state(const XMLNode& node);
|
||||
|
||||
MIDI::Controllable& midi_rec_enable_control() {
|
||||
return _midi_rec_enable_control;
|
||||
PBD::Controllable& rec_enable_control() {
|
||||
return _rec_enable_control;
|
||||
}
|
||||
|
||||
void reset_midi_control (MIDI::Port*, bool);
|
||||
void send_all_midi_feedback ();
|
||||
|
||||
bool record_enabled() const;
|
||||
void set_meter_point (MeterPoint, void* src);
|
||||
|
||||
|
|
@ -118,7 +115,7 @@ class AudioTrack : public Route
|
|||
|
||||
XMLNode state;
|
||||
Insert* insert;
|
||||
id_t id;
|
||||
PBD::ID id;
|
||||
UndoAction memento;
|
||||
};
|
||||
|
||||
|
|
@ -151,17 +148,16 @@ class AudioTrack : public Route
|
|||
void set_state_part_two ();
|
||||
void set_state_part_three ();
|
||||
|
||||
struct MIDIRecEnableControl : public MIDI::Controllable {
|
||||
MIDIRecEnableControl (AudioTrack&, MIDI::Port *);
|
||||
struct RecEnableControllable : public PBD::Controllable {
|
||||
RecEnableControllable (AudioTrack&);
|
||||
|
||||
void set_value (float);
|
||||
void send_feedback (bool);
|
||||
MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, bool val, bool force = false);
|
||||
float get_value (void) const;
|
||||
|
||||
AudioTrack& track;
|
||||
bool setting;
|
||||
bool last_written;
|
||||
};
|
||||
|
||||
MIDIRecEnableControl _midi_rec_enable_control;
|
||||
RecEnableControllable _rec_enable_control;
|
||||
|
||||
bool _destructive;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class AudioFileSource : public AudioSource {
|
|||
static void set_bwf_serial_number (int);
|
||||
|
||||
static void set_search_path (string);
|
||||
static void set_header_position_offset (jack_nframes_t offset, bool negative);
|
||||
static void set_header_position_offset (jack_nframes_t offset );
|
||||
|
||||
static sigc::signal<void> HeaderPositionOffsetChanged;
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ class AudioFileSource : public AudioSource {
|
|||
to cause issues.
|
||||
*/
|
||||
|
||||
void handle_header_position_change ();
|
||||
virtual void handle_header_position_change ();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
@ -141,7 +141,6 @@ class AudioFileSource : public AudioSource {
|
|||
static char bwf_serial_number[13];
|
||||
|
||||
static uint64_t header_position_offset;
|
||||
static bool header_position_negative;
|
||||
|
||||
virtual void set_timeline_position (jack_nframes_t pos);
|
||||
virtual void set_header_timeline_position () = 0;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include <ardour/source.h>
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <pbd/stateful.h>
|
||||
#include <pbd/xml++.h>
|
||||
|
||||
using std::list;
|
||||
|
|
@ -51,6 +51,13 @@ class AudioSource : public Source
|
|||
AudioSource (const XMLNode&);
|
||||
virtual ~AudioSource ();
|
||||
|
||||
/* one could argue that this should belong to Source, but other data types
|
||||
generally do not come with a model of "offset along an audio timeline"
|
||||
so its here in AudioSource for now.
|
||||
*/
|
||||
|
||||
virtual jack_nframes_t natural_position() const { return 0; }
|
||||
|
||||
/* returns the number of items in this `audio_source' */
|
||||
|
||||
virtual jack_nframes_t length() const {
|
||||
|
|
|
|||
|
|
@ -27,8 +27,9 @@
|
|||
#include <sys/types.h>
|
||||
#include <string>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/types.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/utils.h>
|
||||
#include <ardour/configuration_variable.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <string>
|
||||
#include <sigc++/signal.h>
|
||||
#include <glibmm/thread.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
using std::vector;
|
||||
using std::string;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <glibmm/thread.h>
|
||||
|
||||
#include <ardour/stateful.h>
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
|
|
@ -23,6 +23,7 @@ struct ControlProtocolInfo {
|
|||
std::string path;
|
||||
bool requested;
|
||||
bool mandatory;
|
||||
XMLNode* state;
|
||||
};
|
||||
|
||||
class ControlProtocolManager : public sigc::trackable, public Stateful
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ class DestructiveFileSource : public SndFileSource {
|
|||
protected:
|
||||
jack_nframes_t write_unlocked (Sample *src, jack_nframes_t cnt, char * workbuf);
|
||||
|
||||
virtual void handle_header_position_change ();
|
||||
|
||||
private:
|
||||
static jack_nframes_t xfade_frames;
|
||||
static gain_t* out_coefficient;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include <pbd/fastlog.h>
|
||||
#include <pbd/ringbufferNPT.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/configuration.h>
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
#include <ardour/route.h>
|
||||
#include <ardour/port.h>
|
||||
#include <ardour/utils.h>
|
||||
#include <ardour/stateful.h>
|
||||
|
||||
|
||||
struct tm;
|
||||
|
||||
|
|
@ -67,9 +67,6 @@ class Diskstream : public Stateful, public sigc::trackable
|
|||
Destructive = 0x4
|
||||
};
|
||||
|
||||
Diskstream (Session &, const string& name, Flag f = Recordable);
|
||||
Diskstream (Session &, const XMLNode&);
|
||||
|
||||
string name () const { return _name; }
|
||||
virtual int set_name (string str, void* src);
|
||||
|
||||
|
|
@ -99,7 +96,7 @@ class Diskstream : public Stateful, public sigc::trackable
|
|||
bool destructive() const { return _flags & Destructive; }
|
||||
virtual void set_destructive (bool yn);
|
||||
|
||||
id_t id() const { return _id; }
|
||||
const PBD::ID& id() const { return _id; }
|
||||
bool hidden() const { return _flags & Hidden; }
|
||||
bool recordable() const { return _flags & Recordable; }
|
||||
bool reversed() const { return _actual_speed < 0.0f; }
|
||||
|
|
@ -165,6 +162,9 @@ class Diskstream : public Stateful, public sigc::trackable
|
|||
protected:
|
||||
friend class Session;
|
||||
|
||||
Diskstream (Session &, const string& name, Flag f = Recordable);
|
||||
Diskstream (Session &, const XMLNode&);
|
||||
|
||||
/* the Session is the only point of access for these
|
||||
because they require that the Session is "inactive"
|
||||
while they are called.
|
||||
|
|
@ -280,7 +280,7 @@ class Diskstream : public Stateful, public sigc::trackable
|
|||
ARDOUR::Session& _session;
|
||||
ARDOUR::IO* _io;
|
||||
uint32_t _n_channels;
|
||||
id_t _id;
|
||||
PBD::ID _id;
|
||||
|
||||
mutable gint _record_enabled;
|
||||
double _visible_speed;
|
||||
|
|
|
|||
|
|
@ -133,9 +133,6 @@ class PluginInsert : public Insert
|
|||
|
||||
bool is_generator() const;
|
||||
|
||||
void reset_midi_control (MIDI::Port*, bool);
|
||||
void send_all_midi_feedback ();
|
||||
|
||||
void set_parameter (uint32_t port, float val);
|
||||
|
||||
AutoState get_port_automation_state (uint32_t port);
|
||||
|
|
|
|||
|
|
@ -31,11 +31,10 @@
|
|||
|
||||
#include <pbd/fastlog.h>
|
||||
#include <pbd/undo.h>
|
||||
|
||||
#include <midi++/controllable.h>
|
||||
#include <pbd/stateful.h>
|
||||
#include <pbd/controllable.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/utils.h>
|
||||
#include <ardour/state_manager.h>
|
||||
#include <ardour/curve.h>
|
||||
|
|
@ -186,25 +185,10 @@ class IO : public Stateful, public ARDOUR::StateManager
|
|||
static sigc::signal<void,uint32_t> MoreOutputs;
|
||||
static sigc::signal<int> PortsCreated;
|
||||
|
||||
/* MIDI control */
|
||||
|
||||
void set_midi_to_gain_function (gain_t (*function)(double val)) {
|
||||
_midi_gain_control.midi_to_gain = function;
|
||||
PBD::Controllable& gain_control() {
|
||||
return _gain_control;
|
||||
}
|
||||
|
||||
void set_gain_to_midi_function (double (*function)(gain_t gain)) {
|
||||
_midi_gain_control.gain_to_midi = function;
|
||||
}
|
||||
|
||||
MIDI::Controllable& midi_gain_control() {
|
||||
return _midi_gain_control;
|
||||
}
|
||||
|
||||
virtual void reset_midi_control (MIDI::Port*, bool on);
|
||||
|
||||
virtual void send_all_midi_feedback ();
|
||||
virtual MIDI::byte* write_midi_feedback (MIDI::byte*, int32_t& bufsize);
|
||||
|
||||
/* Peak metering */
|
||||
|
||||
float peak_input_power (uint32_t n) {
|
||||
|
|
@ -266,7 +250,7 @@ public:
|
|||
void start_pan_touch (uint32_t which);
|
||||
void end_pan_touch (uint32_t which);
|
||||
|
||||
id_t id() const { return _id; }
|
||||
const PBD::ID& id() const { return _id; }
|
||||
|
||||
void defer_pan_reset ();
|
||||
void allow_pan_reset ();
|
||||
|
|
@ -295,7 +279,7 @@ public:
|
|||
string _name;
|
||||
Connection* _input_connection;
|
||||
Connection* _output_connection;
|
||||
id_t _id;
|
||||
PBD::ID _id;
|
||||
bool no_panner_reset;
|
||||
XMLNode* deferred_state;
|
||||
Buffer::Type _default_type;
|
||||
|
|
@ -310,31 +294,22 @@ public:
|
|||
static void apply_declick (vector<Sample*>&, uint32_t nbufs, jack_nframes_t nframes,
|
||||
gain_t initial, gain_t target, bool invert_polarity);
|
||||
|
||||
struct MIDIGainControl : public MIDI::Controllable {
|
||||
MIDIGainControl (IO&, MIDI::Port *);
|
||||
void set_value (float);
|
||||
struct GainControllable : public PBD::Controllable {
|
||||
GainControllable (IO& i) : io (i) {}
|
||||
|
||||
void send_feedback (gain_t);
|
||||
MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, gain_t val, bool force = false);
|
||||
void set_value (float val);
|
||||
float get_value (void) const;
|
||||
|
||||
IO& io;
|
||||
bool setting;
|
||||
MIDI::byte last_written;
|
||||
|
||||
gain_t (*midi_to_gain) (double val);
|
||||
double (*gain_to_midi) (gain_t gain);
|
||||
};
|
||||
|
||||
MIDIGainControl _midi_gain_control;
|
||||
GainControllable _gain_control;
|
||||
|
||||
/* state management */
|
||||
|
||||
Change restore_state (State&);
|
||||
StateManager::State* state_factory (std::string why) const;
|
||||
|
||||
bool get_midi_node_info (XMLNode * node, MIDI::eventType & ev, MIDI::channel_t & chan, MIDI::byte & additional);
|
||||
bool set_midi_node_info (XMLNode * node, MIDI::eventType ev, MIDI::channel_t chan, MIDI::byte additional);
|
||||
|
||||
/* automation */
|
||||
|
||||
jack_nframes_t last_automation_snapshot;
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@
|
|||
#include <string>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <midi++/controllable.h>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <jack/types.h>
|
||||
#include <ardour/ladspa.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/plugin_state.h>
|
||||
#include <ardour/plugin.h>
|
||||
#include <ardour/ladspa_plugin.h>
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@
|
|||
#include <glibmm/thread.h>
|
||||
|
||||
#include <pbd/undo.h>
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include "ardour.h"
|
||||
#include "stateful.h"
|
||||
#include "state_manager.h"
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/state_manager.h>
|
||||
|
||||
using std::string;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include <ardour/source.h>
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <pbd/stateful.h>
|
||||
#include <pbd/xml++.h>
|
||||
|
||||
using std::string;
|
||||
|
|
|
|||
|
|
@ -54,11 +54,11 @@ public:
|
|||
|
||||
void set_record_enable (bool yn, void *src);
|
||||
|
||||
MidiDiskstream& disk_stream() const { return *diskstream; }
|
||||
MidiDiskstream& disk_stream() const { return *_diskstream; }
|
||||
|
||||
int set_diskstream (MidiDiskstream&, void *);
|
||||
int use_diskstream (string name);
|
||||
int use_diskstream (id_t id);
|
||||
int use_diskstream (const PBD::ID& id);
|
||||
|
||||
TrackMode mode() const { return _mode; }
|
||||
|
||||
|
|
@ -93,16 +93,13 @@ public:
|
|||
XMLNode& get_template();
|
||||
int set_state(const XMLNode& node);
|
||||
|
||||
MIDI::Controllable& midi_rec_enable_control() { return _midi_rec_enable_control; }
|
||||
|
||||
void reset_midi_control (MIDI::Port*, bool);
|
||||
void send_all_midi_feedback ();
|
||||
PBD::Controllable& rec_enable_control() { return _rec_enable_control; }
|
||||
|
||||
bool record_enabled() const;
|
||||
void set_meter_point (MeterPoint, void* src);
|
||||
|
||||
protected:
|
||||
MidiDiskstream *diskstream;
|
||||
MidiDiskstream *_diskstream;
|
||||
MeterPoint _saved_meter_point;
|
||||
TrackMode _mode;
|
||||
|
||||
|
|
@ -123,7 +120,7 @@ private:
|
|||
|
||||
XMLNode state;
|
||||
Insert* insert;
|
||||
id_t id;
|
||||
PBD::ID id;
|
||||
UndoAction memento;
|
||||
};
|
||||
|
||||
|
|
@ -158,18 +155,16 @@ private:
|
|||
void set_state_part_two ();
|
||||
void set_state_part_three ();
|
||||
|
||||
struct MIDIRecEnableControl : public MIDI::Controllable
|
||||
{
|
||||
MIDIRecEnableControl (MidiTrack&, MIDI::Port *);
|
||||
struct MIDIRecEnableControllable : public PBD::Controllable {
|
||||
MIDIRecEnableControllable (MidiTrack&);
|
||||
|
||||
void set_value (float);
|
||||
void send_feedback (bool);
|
||||
MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, bool val, bool force = false);
|
||||
float get_value (void) const;
|
||||
|
||||
MidiTrack& track;
|
||||
bool setting;
|
||||
bool last_written;
|
||||
};
|
||||
|
||||
MIDIRecEnableControl _midi_rec_enable_control;
|
||||
MIDIRecEnableControllable _rec_enable_control;
|
||||
|
||||
bool _destructive;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#include <ardour/stateful.h>
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
class XMLNode;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@
|
|||
#include <iostream>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include <midi++/controllable.h>
|
||||
#include <pbd/stateful.h>
|
||||
#include <pbd/controllable.h>
|
||||
|
||||
#include <ardour/types.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/curve.h>
|
||||
|
||||
using std::istream;
|
||||
|
|
@ -75,24 +75,7 @@ class StreamPanner : public sigc::trackable, public Stateful
|
|||
virtual void set_automation_state (AutoState) = 0;
|
||||
virtual void set_automation_style (AutoStyle) = 0;
|
||||
|
||||
/* MIDI control */
|
||||
|
||||
struct MIDIControl : public MIDI::Controllable {
|
||||
MIDIControl (StreamPanner&, MIDI::Port *);
|
||||
void set_value (float);
|
||||
void send_feedback (gain_t);
|
||||
MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, gain_t val, bool force = false);
|
||||
|
||||
pan_t (*midi_to_pan)(double val);
|
||||
double (*pan_to_midi)(pan_t p);
|
||||
|
||||
StreamPanner& sp;
|
||||
bool setting;
|
||||
gain_t last_written;
|
||||
};
|
||||
|
||||
MIDIControl& midi_control() { return _midi_control; }
|
||||
void reset_midi_control (MIDI::Port *, bool);
|
||||
PBD::Controllable& control() { return _control; }
|
||||
|
||||
/* XXX this is wrong. for multi-dimensional panners, there
|
||||
must surely be more than 1 automation curve.
|
||||
|
|
@ -100,7 +83,6 @@ class StreamPanner : public sigc::trackable, public Stateful
|
|||
|
||||
virtual Curve& automation() = 0;
|
||||
|
||||
|
||||
virtual int load (istream&, string path, uint32_t&) = 0;
|
||||
|
||||
virtual int save (ostream&) const = 0;
|
||||
|
|
@ -130,12 +112,20 @@ class StreamPanner : public sigc::trackable, public Stateful
|
|||
float effective_z;
|
||||
|
||||
bool _muted;
|
||||
MIDIControl _midi_control;
|
||||
|
||||
struct PanControllable : public PBD::Controllable {
|
||||
PanControllable (StreamPanner& p) : panner (p) {}
|
||||
|
||||
StreamPanner& panner;
|
||||
|
||||
void set_value (float);
|
||||
float get_value (void) const;
|
||||
bool can_send_feedback() const;
|
||||
};
|
||||
|
||||
PanControllable _control;
|
||||
|
||||
void add_state (XMLNode&);
|
||||
bool get_midi_node_info (XMLNode * node, MIDI::eventType & ev, MIDI::channel_t & chan, MIDI::byte & additional);
|
||||
bool set_midi_node_info (XMLNode * node, MIDI::eventType ev, MIDI::channel_t chan, MIDI::byte additional);
|
||||
|
||||
virtual void update () = 0;
|
||||
};
|
||||
|
||||
|
|
@ -290,10 +280,6 @@ class Panner : public std::vector<StreamPanner*>, public Stateful, public sigc::
|
|||
std::vector<Output> outputs;
|
||||
Session& session() const { return _session; }
|
||||
|
||||
void reset_midi_control (MIDI::Port *, bool);
|
||||
void send_all_midi_feedback ();
|
||||
MIDI::byte* write_midi_feedback (MIDI::byte*, int32_t& bufsize);
|
||||
|
||||
enum LinkDirection {
|
||||
SameDirection,
|
||||
OppositeDirection
|
||||
|
|
|
|||
|
|
@ -31,12 +31,13 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include <pbd/undo.h>
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/crossfade_compare.h>
|
||||
#include <ardour/location.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/state_manager.h>
|
||||
|
||||
namespace ARDOUR {
|
||||
|
|
@ -86,7 +87,7 @@ class Playlist : public Stateful, public StateManager {
|
|||
void duplicate (Region&, jack_nframes_t position, float times);
|
||||
void nudge_after (jack_nframes_t start, jack_nframes_t distance, bool forwards);
|
||||
|
||||
Region* find_region (id_t) const;
|
||||
Region* find_region (const PBD::ID&) const;
|
||||
|
||||
Playlist* cut (list<AudioRange>&, bool result_is_hidden = true);
|
||||
Playlist* copy (list<AudioRange>&, bool result_is_hidden = true);
|
||||
|
|
@ -135,8 +136,8 @@ class Playlist : public Stateful, public StateManager {
|
|||
|
||||
Session& session() { return _session; }
|
||||
|
||||
id_t get_orig_diskstream_id () const { return _orig_diskstream_id; }
|
||||
void set_orig_diskstream_id (id_t did) { _orig_diskstream_id = did; }
|
||||
const PBD::ID& get_orig_diskstream_id () const { return _orig_diskstream_id; }
|
||||
void set_orig_diskstream_id (const PBD::ID& did) { _orig_diskstream_id = did; }
|
||||
|
||||
/* destructive editing */
|
||||
|
||||
|
|
@ -190,7 +191,7 @@ class Playlist : public Stateful, public StateManager {
|
|||
bool _frozen;
|
||||
uint32_t subcnt;
|
||||
uint32_t _read_data_count;
|
||||
id_t _orig_diskstream_id;
|
||||
PBD::ID _orig_diskstream_id;
|
||||
uint64_t layer_op_counter;
|
||||
jack_nframes_t freeze_length;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,12 +21,13 @@
|
|||
#ifndef __ardour_ladspa_h__
|
||||
#define __ardour_ladspa_h__
|
||||
|
||||
#include <midi++/controllable.h>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
#include <pbd/controllable.h>
|
||||
|
||||
#include <jack/types.h>
|
||||
#include <ardour/types.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/plugin_state.h>
|
||||
#include <ardour/cycles.h>
|
||||
|
||||
|
|
@ -136,10 +137,7 @@ class Plugin : public Stateful, public sigc::trackable
|
|||
sigc::signal<void,uint32_t,float> ParameterChanged;
|
||||
sigc::signal<void,Plugin *> GoingAway;
|
||||
|
||||
void reset_midi_control (MIDI::Port*, bool);
|
||||
void send_all_midi_feedback ();
|
||||
MIDI::byte* write_midi_feedback (MIDI::byte*, int32_t& bufsize);
|
||||
MIDI::Controllable *get_nth_midi_control (uint32_t);
|
||||
PBD::Controllable *get_nth_control (uint32_t);
|
||||
|
||||
PluginInfo & get_info() { return _info; }
|
||||
void set_info (const PluginInfo &inf) { _info = inf; }
|
||||
|
|
@ -158,16 +156,14 @@ class Plugin : public Stateful, public sigc::trackable
|
|||
map<string,string> presets;
|
||||
bool save_preset(string name, string domain /* vst, ladspa etc. */);
|
||||
|
||||
void setup_midi_controls ();
|
||||
void setup_controls ();
|
||||
|
||||
|
||||
struct MIDIPortControl : public MIDI::Controllable {
|
||||
MIDIPortControl (Plugin&, uint32_t abs_port_id, MIDI::Port *,
|
||||
struct PortControllable : public PBD::Controllable {
|
||||
PortControllable (Plugin&, uint32_t abs_port_id,
|
||||
float lower, float upper, bool toggled, bool logarithmic);
|
||||
|
||||
void set_value (float);
|
||||
void send_feedback (float);
|
||||
MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, float val, bool force = false);
|
||||
float get_value () const;
|
||||
|
||||
Plugin& plugin;
|
||||
uint32_t absolute_port;
|
||||
|
|
@ -176,14 +172,9 @@ class Plugin : public Stateful, public sigc::trackable
|
|||
float range;
|
||||
bool toggled;
|
||||
bool logarithmic;
|
||||
|
||||
bool setting;
|
||||
float last_written;
|
||||
};
|
||||
|
||||
vector<MIDIPortControl*> midi_controls;
|
||||
|
||||
|
||||
vector<PortControllable*> controls;
|
||||
};
|
||||
|
||||
/* this is actually defined in plugin_manager.cc */
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class Region : public Stateful, public StateManager
|
|||
Region (const XMLNode&);
|
||||
~Region();
|
||||
|
||||
ARDOUR::id_t id() const { return _id; }
|
||||
const PBD::ID& id() const { return _id; }
|
||||
|
||||
/* Note: changing the name of a Region does not constitute an edit */
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ class Region : public Stateful, public StateManager
|
|||
mutable RegionEditState _first_edit;
|
||||
int _frozen;
|
||||
Glib::Mutex lock;
|
||||
ARDOUR::id_t _id;
|
||||
PBD::ID _id;
|
||||
ARDOUR::Playlist* _playlist;
|
||||
mutable uint32_t _read_data_count; // modified in read()
|
||||
Change pending_changed;
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
#include <glibmm/thread.h>
|
||||
#include <pbd/xml++.h>
|
||||
#include <pbd/undo.h>
|
||||
#include <midi++/controllable.h>
|
||||
#include <pbd/stateful.h>
|
||||
#include <pbd/controllable.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/io.h>
|
||||
#include <ardour/session.h>
|
||||
#include <ardour/redirect.h>
|
||||
|
|
@ -215,33 +215,27 @@ class Route : public IO
|
|||
bool feeds (Route *);
|
||||
set<Route *> fed_by;
|
||||
|
||||
struct MIDIToggleControl : public MIDI::Controllable {
|
||||
struct ToggleControllable : public PBD::Controllable {
|
||||
enum ToggleType {
|
||||
MuteControl = 0,
|
||||
SoloControl
|
||||
};
|
||||
|
||||
MIDIToggleControl (Route&, ToggleType, MIDI::Port *);
|
||||
ToggleControllable (Route&, ToggleType);
|
||||
void set_value (float);
|
||||
void send_feedback (bool);
|
||||
MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, bool val, bool force = false);
|
||||
float get_value (void) const;
|
||||
|
||||
Route& route;
|
||||
ToggleType type;
|
||||
bool setting;
|
||||
bool last_written;
|
||||
};
|
||||
|
||||
MIDI::Controllable& midi_solo_control() {
|
||||
return _midi_solo_control;
|
||||
}
|
||||
MIDI::Controllable& midi_mute_control() {
|
||||
return _midi_mute_control;
|
||||
PBD::Controllable& solo_control() {
|
||||
return _solo_control;
|
||||
}
|
||||
|
||||
virtual void reset_midi_control (MIDI::Port*, bool);
|
||||
virtual void send_all_midi_feedback ();
|
||||
virtual MIDI::byte* write_midi_feedback (MIDI::byte*, int32_t& bufsize);
|
||||
PBD::Controllable& mute_control() {
|
||||
return _mute_control;
|
||||
}
|
||||
|
||||
void automation_snapshot (jack_nframes_t now);
|
||||
|
||||
|
|
@ -302,8 +296,8 @@ class Route : public IO
|
|||
std::string _comment;
|
||||
bool _have_internal_generator;
|
||||
|
||||
MIDIToggleControl _midi_solo_control;
|
||||
MIDIToggleControl _midi_mute_control;
|
||||
ToggleControllable _solo_control;
|
||||
ToggleControllable _mute_control;
|
||||
|
||||
void passthru (jack_nframes_t start_frame, jack_nframes_t end_frame,
|
||||
jack_nframes_t nframes, jack_nframes_t offset, int declick, bool meter_inputs);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include <string>
|
||||
#include <stdint.h>
|
||||
#include <sigc++/signal.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <pbd/stateful.h>
|
||||
#include <ardour/types.h>
|
||||
|
||||
using std::string;
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@
|
|||
#include <sigc++/signal.h>
|
||||
#include <string>
|
||||
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/audioengine.h>
|
||||
|
||||
#include "io.h"
|
||||
#include "stateful.h"
|
||||
#include "redirect.h"
|
||||
#include <ardour/io.h>
|
||||
#include <ardour/redirect.h>
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
|
|
|
|||
|
|
@ -40,10 +40,11 @@
|
|||
#include <midi++/types.h>
|
||||
#include <midi++/mmc.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/configuration.h>
|
||||
#include <ardour/location.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/gain.h>
|
||||
#include <ardour/io.h>
|
||||
|
||||
|
|
@ -57,6 +58,10 @@ namespace MIDI {
|
|||
class Port;
|
||||
}
|
||||
|
||||
namespace PBD {
|
||||
class Controllable;
|
||||
}
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
class Port;
|
||||
|
|
@ -274,7 +279,7 @@ class Session : public sigc::trackable, public Stateful
|
|||
vector<Sample*>& get_silent_buffers (uint32_t howmany);
|
||||
vector<Sample*>& get_send_buffers () { return _send_buffers; }
|
||||
|
||||
Diskstream *diskstream_by_id (id_t id);
|
||||
Diskstream *diskstream_by_id (const PBD::ID& id);
|
||||
Diskstream *diskstream_by_name (string name);
|
||||
|
||||
bool have_captured() const { return _have_captured; }
|
||||
|
|
@ -706,7 +711,7 @@ class Session : public sigc::trackable, public Stateful
|
|||
|
||||
AudioFileSource *create_audio_source_for_session (ARDOUR::AudioDiskstream&, uint32_t which_channel, bool destructive);
|
||||
|
||||
Source *get_source (ARDOUR::id_t);
|
||||
Source *source_by_id (const PBD::ID&);
|
||||
|
||||
/* playlist management */
|
||||
|
||||
|
|
@ -968,6 +973,12 @@ class Session : public sigc::trackable, public Stateful
|
|||
static mix_buffers_with_gain_t mix_buffers_with_gain;
|
||||
static mix_buffers_no_gain_t mix_buffers_no_gain;
|
||||
|
||||
static sigc::signal<void> SendFeedback;
|
||||
|
||||
/* Controllables */
|
||||
|
||||
PBD::Controllable* controllable_by_id (const PBD::ID&);
|
||||
|
||||
protected:
|
||||
friend class AudioEngine;
|
||||
void set_block_size (jack_nframes_t nframes);
|
||||
|
|
@ -1502,7 +1513,7 @@ class Session : public sigc::trackable, public Stateful
|
|||
/* REGION MANAGEMENT */
|
||||
|
||||
mutable Glib::Mutex region_lock;
|
||||
typedef map<ARDOUR::id_t,AudioRegion *> AudioRegionList;
|
||||
typedef map<PBD::ID,AudioRegion *> AudioRegionList;
|
||||
AudioRegionList audio_regions;
|
||||
|
||||
void region_renamed (Region *);
|
||||
|
|
@ -1515,7 +1526,7 @@ class Session : public sigc::trackable, public Stateful
|
|||
/* SOURCES */
|
||||
|
||||
mutable Glib::Mutex audio_source_lock;
|
||||
typedef std::map<id_t, AudioSource *> AudioSourceList;
|
||||
typedef std::map<PBD::ID,AudioSource *> AudioSourceList;
|
||||
|
||||
AudioSourceList audio_sources;
|
||||
|
||||
|
|
@ -1743,6 +1754,13 @@ class Session : public sigc::trackable, public Stateful
|
|||
|
||||
LayerModel layer_model;
|
||||
CrossfadeModel xfade_model;
|
||||
|
||||
typedef std::list<PBD::Controllable*> Controllables;
|
||||
Glib::Mutex controllables_lock;
|
||||
Controllables controllables;
|
||||
|
||||
void add_controllable (PBD::Controllable*);
|
||||
void remove_controllable (PBD::Controllable*);
|
||||
};
|
||||
|
||||
}; /* namespace ARDOUR */
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ template<class T> void Session::foreach_audio_region (T *obj, void (T::*func)(Au
|
|||
{
|
||||
Glib::Mutex::Lock lm (region_lock);
|
||||
for (AudioRegionList::iterator i = audio_regions.begin(); i != audio_regions.end(); i++) {
|
||||
(obj->*func) ((*i).second);
|
||||
(obj->*func) (i->second);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class SndFileSource : public AudioFileSource {
|
|||
int update_header (jack_nframes_t when, struct tm&, time_t);
|
||||
int flush_header ();
|
||||
|
||||
void handle_smpte_offset_change (jack_nframes_t offset, bool negative);
|
||||
jack_nframes_t natural_position () const;
|
||||
|
||||
protected:
|
||||
void set_header_timeline_position ();
|
||||
|
|
|
|||
|
|
@ -25,8 +25,9 @@
|
|||
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/stateful.h>
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
|
|
@ -40,7 +41,7 @@ class Source : public Stateful, public sigc::trackable
|
|||
std::string name() const { return _name; }
|
||||
int set_name (std::string str, bool destructive);
|
||||
|
||||
ARDOUR::id_t id() const { return _id; }
|
||||
const PBD::ID& id() const { return _id; }
|
||||
|
||||
uint32_t use_cnt() const { return _use_cnt; }
|
||||
void use ();
|
||||
|
|
@ -60,7 +61,7 @@ class Source : public Stateful, public sigc::trackable
|
|||
time_t _timestamp;
|
||||
|
||||
private:
|
||||
ARDOUR::id_t _id;
|
||||
PBD::ID _id;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@
|
|||
#include <cmath>
|
||||
#include <glibmm/thread.h>
|
||||
#include <pbd/undo.h>
|
||||
#include <pbd/stateful.h>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/state_manager.h>
|
||||
|
||||
class XMLNode;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
#include <inttypes.h>
|
||||
#include <jack/types.h>
|
||||
#include <control_protocol/smpte.h>
|
||||
#include <pbd/id.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
#if __GNUC__ < 3
|
||||
|
|
@ -45,7 +47,7 @@ namespace ARDOUR {
|
|||
typedef float pan_t;
|
||||
typedef float gain_t;
|
||||
typedef uint32_t layer_t;
|
||||
typedef uint64_t id_t;
|
||||
typedef uint64_t microseconds_t;
|
||||
|
||||
typedef unsigned char RawMidi;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ int tokenize_fullpath (std::string fullpath, std::string& path, std::string& nam
|
|||
|
||||
int touch_file(std::string path);
|
||||
|
||||
uint32_t long get_uid();
|
||||
|
||||
std::string region_name_from_path (std::string path);
|
||||
std::string path_expand (std::string);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,11 +28,9 @@
|
|||
#include <string>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <midi++/controllable.h>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
#include <pbd/stateful.h>
|
||||
#include <jack/types.h>
|
||||
#include <ardour/stateful.h>
|
||||
#include <ardour/plugin_state.h>
|
||||
#include <ardour/plugin.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ AudioDiskstream::AudioDiskstream (Session &sess, const string &name, Diskstream:
|
|||
|
||||
in_set_state = true;
|
||||
|
||||
init (flag);
|
||||
init(flag);
|
||||
use_new_playlist ();
|
||||
|
||||
in_set_state = false;
|
||||
|
|
@ -185,7 +185,7 @@ AudioDiskstream::~AudioDiskstream ()
|
|||
|
||||
channels.clear();
|
||||
}
|
||||
/*
|
||||
|
||||
void
|
||||
AudioDiskstream::handle_input_change (IOChange change, void *src)
|
||||
{
|
||||
|
|
@ -196,7 +196,7 @@ AudioDiskstream::handle_input_change (IOChange change, void *src)
|
|||
_session.request_input_change_handling ();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void
|
||||
AudioDiskstream::non_realtime_input_change ()
|
||||
{
|
||||
|
|
@ -421,8 +421,10 @@ AudioDiskstream::setup_destructive_playlist ()
|
|||
|
||||
/* a single full-sized region */
|
||||
|
||||
cerr << "setup DS using " << srcs.front()->natural_position () << endl;
|
||||
|
||||
AudioRegion* region = new AudioRegion (srcs, 0, max_frames, _name);
|
||||
_playlist->add_region (*region, 0);
|
||||
_playlist->add_region (*region, srcs.front()->natural_position());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1040,6 +1042,12 @@ AudioDiskstream::seek (jack_nframes_t frame, bool complete_refill)
|
|||
(*chan).capture_buf->reset ();
|
||||
}
|
||||
|
||||
/* can't rec-enable in destructive mode if transport is before start */
|
||||
|
||||
if (destructive() && record_enabled() && frame < _session.current_start_frame()) {
|
||||
disengage_record_enable (this);
|
||||
}
|
||||
|
||||
playback_sample = frame;
|
||||
file_frame = frame;
|
||||
|
||||
|
|
@ -1451,7 +1459,6 @@ AudioDiskstream::do_flush (char * workbuf, bool force_flush)
|
|||
|
||||
to_write = min (disk_io_chunk_frames, (jack_nframes_t) vector.len[0]);
|
||||
|
||||
|
||||
// check the transition buffer when recording destructive
|
||||
// important that we get this after the capture buf
|
||||
|
||||
|
|
@ -1773,15 +1780,15 @@ AudioDiskstream::finish_capture (bool rec_monitors_input)
|
|||
void
|
||||
AudioDiskstream::set_record_enabled (bool yn, void* src)
|
||||
{
|
||||
bool rolling = _session.transport_speed() != 0.0f;
|
||||
|
||||
if (!recordable() || !_session.record_enabling_legal()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* if we're turning on rec-enable, there needs to be an
|
||||
input connection.
|
||||
*/
|
||||
/* can't rec-enable in destructive mode if transport is before start */
|
||||
|
||||
if (destructive() && yn && _session.transport_frame() < _session.current_start_frame()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (yn && channels[0].source == 0) {
|
||||
|
||||
|
|
@ -1798,6 +1805,18 @@ AudioDiskstream::set_record_enabled (bool yn, void* src)
|
|||
|
||||
if (record_enabled() != yn) {
|
||||
if (yn) {
|
||||
engage_record_enable (src);
|
||||
} else {
|
||||
disengage_record_enable (src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioDiskstream::engage_record_enable (void* src)
|
||||
{
|
||||
bool rolling = _session.transport_speed() != 0.0f;
|
||||
|
||||
g_atomic_int_set (&_record_enabled, 1);
|
||||
capturing_sources.clear ();
|
||||
if (Config->get_use_hardware_monitoring()) {
|
||||
|
|
@ -1813,7 +1832,12 @@ AudioDiskstream::set_record_enabled (bool yn, void* src)
|
|||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
record_enable_changed (src); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
AudioDiskstream::disengage_record_enable (void* src)
|
||||
{
|
||||
g_atomic_int_set (&_record_enabled, 0);
|
||||
if (Config->get_use_hardware_monitoring()) {
|
||||
for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) {
|
||||
|
|
@ -1823,12 +1847,10 @@ AudioDiskstream::set_record_enabled (bool yn, void* src)
|
|||
}
|
||||
}
|
||||
capturing_sources.clear ();
|
||||
}
|
||||
|
||||
record_enable_changed (src); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XMLNode&
|
||||
AudioDiskstream::get_state ()
|
||||
{
|
||||
|
|
@ -1848,7 +1870,7 @@ AudioDiskstream::get_state ()
|
|||
node->add_property ("speed", buf);
|
||||
|
||||
node->add_property("name", _name);
|
||||
snprintf (buf, sizeof(buf), "%" PRIu64, id());
|
||||
id().print (buf);
|
||||
node->add_property("id", buf);
|
||||
|
||||
if (!capturing_sources.empty() && _session.get_record_enabled()) {
|
||||
|
|
@ -1915,11 +1937,11 @@ AudioDiskstream::set_state (const XMLNode& node)
|
|||
|
||||
if (deprecated_io_node) {
|
||||
if ((prop = deprecated_io_node->property ("id")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &_id);
|
||||
_id = prop->value ();
|
||||
}
|
||||
} else {
|
||||
if ((prop = node.property ("id")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &_id);
|
||||
_id = prop->value ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2238,6 +2260,21 @@ AudioDiskstream::capture_buffer_load () const
|
|||
(double) channels.front().capture_buf->bufsize());
|
||||
}
|
||||
|
||||
int
|
||||
AudioDiskstream::set_loop (Location *location)
|
||||
{
|
||||
if (location) {
|
||||
if (location->start() >= location->end()) {
|
||||
error << string_compose(_("Location \"%1\" not valid for track loop (start >= end)"), location->name()) << endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
loop_location = location;
|
||||
|
||||
LoopSet (location); /* EMIT SIGNAL */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
AudioDiskstream::use_pending_capture_data (XMLNode& node)
|
||||
|
|
|
|||
|
|
@ -75,11 +75,16 @@ AudioLibrary::AudioLibrary ()
|
|||
|
||||
lrdf_free_statements(matches);
|
||||
|
||||
XMLNode* state = instant_xml(X_("AudioLibrary"), get_user_ardour_path());
|
||||
if (state) {
|
||||
set_state(*state);
|
||||
}
|
||||
scan_paths();
|
||||
}
|
||||
|
||||
AudioLibrary::~AudioLibrary ()
|
||||
{
|
||||
add_instant_xml(get_state(), get_user_ardour_path());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -429,5 +434,50 @@ AudioLibrary::safe_file_extension(string file)
|
|||
file.rfind(".maud")== string::npos &&
|
||||
file.rfind(".vwe") == string::npos &&
|
||||
file.rfind(".paf") == string::npos &&
|
||||
#ifdef HAVE_COREAUDIO
|
||||
file.rfind(".mp3") == string::npos &&
|
||||
file.rfind(".aac") == string::npos &&
|
||||
file.rfind(".mp4") == string::npos &&
|
||||
#endif // HAVE_COREAUDIO
|
||||
file.rfind(".voc") == string::npos);
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
AudioLibrary::get_state ()
|
||||
{
|
||||
XMLNode* root = new XMLNode(X_("AudioLibrary"));
|
||||
|
||||
for (vector<string>::iterator i = sfdb_paths.begin(); i != sfdb_paths.end(); ++i) {
|
||||
XMLNode* node = new XMLNode(X_("Path"));
|
||||
node->add_property("value", *i);
|
||||
root->add_child_nocopy(*node);
|
||||
}
|
||||
|
||||
return *root;
|
||||
}
|
||||
|
||||
int
|
||||
AudioLibrary::set_state (const XMLNode& node)
|
||||
{
|
||||
if (node.name() != X_("AudioLibrary")) {
|
||||
fatal << "programming error: AudioLibrary: incorrect XML node sent to set_state()" << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
XMLNodeList nodes = node.children(X_("Path"));
|
||||
|
||||
vector<string> paths;
|
||||
XMLProperty* prop;
|
||||
XMLNode* child;
|
||||
for (XMLNodeConstIterator iter = nodes.begin(); iter != nodes.end(); ++iter) {
|
||||
child = *iter;
|
||||
|
||||
if ((prop = child->property(X_("value"))) != 0) {
|
||||
paths.push_back(prop->value());
|
||||
}
|
||||
}
|
||||
|
||||
sfdb_paths = paths;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ using namespace PBD;
|
|||
AudioTrack::AudioTrack (Session& sess, string name, Route::Flag flag, TrackMode mode)
|
||||
: Route (sess, name, 1, -1, -1, -1, flag),
|
||||
_diskstream (0),
|
||||
_midi_rec_enable_control (*this, _session.midi_port())
|
||||
_rec_enable_control (*this)
|
||||
{
|
||||
AudioDiskstream::Flag dflags = AudioDiskstream::Flag (0);
|
||||
|
||||
|
|
@ -65,26 +65,17 @@ AudioTrack::AudioTrack (Session& sess, string name, Route::Flag flag, TrackMode
|
|||
_mode = mode;
|
||||
|
||||
set_diskstream (*ds, this);
|
||||
|
||||
// session.SMPTEOffsetChanged.connect (mem_fun (*this, &AudioTrack::handle_smpte_offset_change));
|
||||
|
||||
// we do this even though Route already did it in it's init
|
||||
reset_midi_control (_session.midi_port(), _session.get_midi_control());
|
||||
|
||||
}
|
||||
|
||||
AudioTrack::AudioTrack (Session& sess, const XMLNode& node)
|
||||
: Route (sess, "to be renamed", 0, 0, -1, -1),
|
||||
_diskstream (0),
|
||||
_midi_rec_enable_control (*this, _session.midi_port())
|
||||
_rec_enable_control (*this)
|
||||
{
|
||||
_freeze_record.state = NoFreeze;
|
||||
set_state (node);
|
||||
_declickable = true;
|
||||
_saved_meter_point = _meter_point;
|
||||
|
||||
// we do this even though Route already did it in it's init
|
||||
reset_midi_control (_session.midi_port(), _session.get_midi_control());
|
||||
}
|
||||
|
||||
AudioTrack::~AudioTrack ()
|
||||
|
|
@ -191,7 +182,7 @@ AudioTrack::use_diskstream (string name)
|
|||
}
|
||||
|
||||
int
|
||||
AudioTrack::use_diskstream (id_t id)
|
||||
AudioTrack::use_diskstream (const PBD::ID& id)
|
||||
{
|
||||
AudioDiskstream *dstream;
|
||||
|
||||
|
|
@ -235,10 +226,7 @@ AudioTrack::set_record_enable (bool yn, void *src)
|
|||
set_meter_point (_saved_meter_point, this);
|
||||
}
|
||||
|
||||
if (_session.get_midi_feedback()) {
|
||||
_midi_rec_enable_control.send_feedback (record_enabled());
|
||||
}
|
||||
|
||||
_rec_enable_control.Changed ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -252,7 +240,6 @@ AudioTrack::set_state (const XMLNode& node)
|
|||
{
|
||||
const XMLProperty *prop;
|
||||
XMLNodeConstIterator iter;
|
||||
XMLNodeList midi_kids;
|
||||
|
||||
if (Route::set_state (node)) {
|
||||
return -1;
|
||||
|
|
@ -271,36 +258,6 @@ AudioTrack::set_state (const XMLNode& node)
|
|||
_mode = Normal;
|
||||
}
|
||||
|
||||
midi_kids = node.children ("MIDI");
|
||||
|
||||
for (iter = midi_kids.begin(); iter != midi_kids.end(); ++iter) {
|
||||
|
||||
XMLNodeList kids;
|
||||
XMLNodeConstIterator miter;
|
||||
XMLNode* child;
|
||||
|
||||
kids = (*iter)->children ();
|
||||
|
||||
for (miter = kids.begin(); miter != kids.end(); ++miter) {
|
||||
|
||||
child =* miter;
|
||||
|
||||
if (child->name() == "rec_enable") {
|
||||
|
||||
MIDI::eventType ev = MIDI::on; /* initialize to keep gcc happy */
|
||||
MIDI::byte additional = 0; /* ditto */
|
||||
MIDI::channel_t chn = 0; /* ditto */
|
||||
|
||||
if (get_midi_node_info (child, ev, chn, additional)) {
|
||||
_midi_rec_enable_control.set_control_type (chn, ev, additional);
|
||||
} else {
|
||||
error << string_compose(_("MIDI rec_enable control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((prop = node.property ("diskstream-id")) == 0) {
|
||||
|
||||
/* some old sessions use the diskstream name rather than the ID */
|
||||
|
|
@ -317,7 +274,7 @@ AudioTrack::set_state (const XMLNode& node)
|
|||
|
||||
} else {
|
||||
|
||||
id_t id = strtoull (prop->value().c_str(), 0, 10);
|
||||
PBD::ID id (prop->value());
|
||||
|
||||
if (use_diskstream (id)) {
|
||||
return -1;
|
||||
|
|
@ -366,7 +323,7 @@ AudioTrack::state(bool full_state)
|
|||
{
|
||||
XMLNode& root (Route::state(full_state));
|
||||
XMLNode* freeze_node;
|
||||
char buf[32];
|
||||
char buf[64];
|
||||
|
||||
if (_freeze_record.playlist) {
|
||||
XMLNode* inode;
|
||||
|
|
@ -378,7 +335,7 @@ AudioTrack::state(bool full_state)
|
|||
|
||||
for (vector<FreezeRecordInsertInfo*>::iterator i = _freeze_record.insert_info.begin(); i != _freeze_record.insert_info.end(); ++i) {
|
||||
inode = new XMLNode (X_("insert"));
|
||||
snprintf (buf, sizeof (buf), "%" PRIu64, (*i)->id);
|
||||
(*i)->id.print (buf);
|
||||
inode->add_property (X_("id"), buf);
|
||||
inode->add_child_copy ((*i)->state);
|
||||
|
||||
|
|
@ -402,29 +359,6 @@ AudioTrack::state(bool full_state)
|
|||
align_node->add_property (X_("style"), buf);
|
||||
root.add_child_nocopy (*align_node);
|
||||
|
||||
/* MIDI control */
|
||||
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte additional;
|
||||
XMLNode* midi_node = 0;
|
||||
XMLNode* child;
|
||||
XMLNodeList midikids;
|
||||
|
||||
midikids = root.children ("MIDI");
|
||||
if (!midikids.empty()) {
|
||||
midi_node = midikids.front();
|
||||
}
|
||||
else {
|
||||
midi_node = root.add_child ("MIDI");
|
||||
}
|
||||
|
||||
if (_midi_rec_enable_control.get_control_info (chn, ev, additional) && midi_node) {
|
||||
|
||||
child = midi_node->add_child ("rec_enable");
|
||||
set_midi_node_info (child, ev, chn, additional);
|
||||
}
|
||||
|
||||
XMLNode* remote_control_node = new XMLNode (X_("remote_control"));
|
||||
snprintf (buf, sizeof (buf), "%d", _remote_control_id);
|
||||
remote_control_node->add_property (X_("id"), buf);
|
||||
|
|
@ -445,7 +379,7 @@ AudioTrack::state(bool full_state)
|
|||
diskstream.
|
||||
*/
|
||||
|
||||
snprintf (buf, sizeof (buf), "%" PRIu64, _diskstream->id());
|
||||
_diskstream->id().print (buf);
|
||||
root.add_property ("diskstream-id", buf);
|
||||
|
||||
return root;
|
||||
|
|
@ -506,7 +440,7 @@ AudioTrack::set_state_part_two ()
|
|||
|
||||
FreezeRecordInsertInfo* frii = new FreezeRecordInsertInfo (*((*citer)->children().front()));
|
||||
frii->insert = 0;
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &frii->id);
|
||||
frii->id = prop->value ();
|
||||
_freeze_record.insert_info.push_back (frii);
|
||||
}
|
||||
}
|
||||
|
|
@ -1054,93 +988,23 @@ AudioTrack::freeze_state() const
|
|||
return _freeze_record.state;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioTrack::reset_midi_control (MIDI::Port* port, bool on)
|
||||
AudioTrack::RecEnableControllable::RecEnableControllable (AudioTrack& s)
|
||||
: track (s)
|
||||
{
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte extra;
|
||||
|
||||
Route::reset_midi_control (port, on);
|
||||
|
||||
_midi_rec_enable_control.get_control_info (chn, ev, extra);
|
||||
if (!on) {
|
||||
chn = -1;
|
||||
}
|
||||
_midi_rec_enable_control.midi_rebind (port, chn);
|
||||
}
|
||||
|
||||
void
|
||||
AudioTrack::send_all_midi_feedback ()
|
||||
{
|
||||
if (_session.get_midi_feedback()) {
|
||||
|
||||
Route::send_all_midi_feedback();
|
||||
|
||||
_midi_rec_enable_control.send_feedback (record_enabled());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AudioTrack::MIDIRecEnableControl::MIDIRecEnableControl (AudioTrack& s, MIDI::Port* port)
|
||||
: MIDI::Controllable (port, 0), track (s), setting(false)
|
||||
{
|
||||
last_written = false; /* XXX need a good out of bound value */
|
||||
}
|
||||
|
||||
void
|
||||
AudioTrack::MIDIRecEnableControl::set_value (float val)
|
||||
AudioTrack::RecEnableControllable::set_value (float val)
|
||||
{
|
||||
bool bval = ((val >= 0.5f) ? true: false);
|
||||
|
||||
setting = true;
|
||||
track.set_record_enable (bval, this);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void
|
||||
AudioTrack::MIDIRecEnableControl::send_feedback (bool value)
|
||||
float
|
||||
AudioTrack::RecEnableControllable::get_value (void) const
|
||||
{
|
||||
|
||||
if (!setting && get_midi_feedback()) {
|
||||
MIDI::byte val = (MIDI::byte) (value ? 127: 0);
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
MIDI::EventTwoBytes data;
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
data.controller_number = additional;
|
||||
data.value = val;
|
||||
|
||||
track._session.send_midi_message (get_port(), ev, ch, data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MIDI::byte*
|
||||
AudioTrack::MIDIRecEnableControl::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool val, bool force)
|
||||
{
|
||||
if (get_midi_feedback()) {
|
||||
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
if (val != last_written || force) {
|
||||
*buf++ = ev & ch;
|
||||
*buf++ = additional; /* controller number */
|
||||
*buf++ = (MIDI::byte) (val ? 127: 0);
|
||||
last_written = val;
|
||||
bufsize -= 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
if (track.record_enabled()) { return 1.0f; }
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -56,8 +56,7 @@ string AudioFileSource::peak_dir = "";
|
|||
string AudioFileSource::search_path;
|
||||
|
||||
sigc::signal<void> AudioFileSource::HeaderPositionOffsetChanged;
|
||||
bool AudioFileSource::header_position_negative;
|
||||
uint64_t AudioFileSource::header_position_offset;
|
||||
uint64_t AudioFileSource::header_position_offset = 0;
|
||||
|
||||
char AudioFileSource::bwf_country_code[3] = "US";
|
||||
char AudioFileSource::bwf_organization_code[4] = "LAS";
|
||||
|
|
@ -592,11 +591,10 @@ AudioFileSource::set_search_path (string p)
|
|||
}
|
||||
|
||||
void
|
||||
AudioFileSource::set_header_position_offset (jack_nframes_t offset, bool negative)
|
||||
AudioFileSource::set_header_position_offset (jack_nframes_t offset)
|
||||
{
|
||||
header_position_offset = offset;
|
||||
header_position_negative = negative;
|
||||
|
||||
cerr << "hpo set to " << offset << endl;
|
||||
HeaderPositionOffsetChanged ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -267,8 +267,6 @@ AudioRegion::AudioRegion (SourceList& srcs, const XMLNode& node)
|
|||
_fade_out (0.0, 2.0, 1.0, false),
|
||||
_envelope (0.0, 2.0, 1.0, false)
|
||||
{
|
||||
/* basic AudioRegion constructor */
|
||||
|
||||
set<AudioSource*> unique_srcs;
|
||||
|
||||
for (SourceList::iterator i=srcs.begin(); i != srcs.end(); ++i) {
|
||||
|
|
@ -657,7 +655,7 @@ AudioRegion::state (bool full)
|
|||
|
||||
for (uint32_t n=0; n < sources.size(); ++n) {
|
||||
snprintf (buf2, sizeof(buf2), "source-%d", n);
|
||||
snprintf (buf, sizeof(buf), "%" PRIu64, sources[n]->id());
|
||||
sources[n]->id().print (buf);
|
||||
node.add_property (buf2, buf);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ ControlProtocolManager::set_session (Session& s)
|
|||
if ((*i)->requested || (*i)->mandatory) {
|
||||
instantiate (**i);
|
||||
(*i)->requested = false;
|
||||
|
||||
if ((*i)->state) {
|
||||
(*i)->protocol->set_state (*(*i)->state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -181,6 +185,7 @@ ControlProtocolManager::control_protocol_discover (string path)
|
|||
cpi->protocol = 0;
|
||||
cpi->requested = false;
|
||||
cpi->mandatory = descriptor->mandatory;
|
||||
cpi->state = 0;
|
||||
|
||||
control_protocol_info.push_back (cpi);
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
|
|||
{
|
||||
Region* r;
|
||||
XMLProperty* prop;
|
||||
id_t id;
|
||||
LocaleGuard lg (X_("POSIX"));
|
||||
|
||||
/* we have to find the in/out regions before we can do anything else */
|
||||
|
|
@ -122,7 +121,7 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
|
|||
throw failed_constructor();
|
||||
}
|
||||
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &id);
|
||||
PBD::ID id (prop->value());
|
||||
|
||||
if ((r = playlist.find_region (id)) == 0) {
|
||||
error << string_compose (_("Crossfade: no \"in\" region %1 found in playlist %2"), id, playlist.name())
|
||||
|
|
@ -139,10 +138,10 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
|
|||
throw failed_constructor();
|
||||
}
|
||||
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &id);
|
||||
PBD::ID id2 (prop->value());
|
||||
|
||||
if ((r = playlist.find_region (id)) == 0) {
|
||||
error << string_compose (_("Crossfade: no \"out\" region %1 found in playlist %2"), id, playlist.name())
|
||||
if ((r = playlist.find_region (id2)) == 0) {
|
||||
error << string_compose (_("Crossfade: no \"out\" region %1 found in playlist %2"), id2, playlist.name())
|
||||
<< endmsg;
|
||||
throw failed_constructor();
|
||||
}
|
||||
|
|
@ -680,9 +679,9 @@ Crossfade::get_state ()
|
|||
char buf[64];
|
||||
LocaleGuard lg (X_("POSIX"));
|
||||
|
||||
snprintf (buf, sizeof(buf), "%" PRIu64, _out->id());
|
||||
_out->id().print (buf);
|
||||
node->add_property ("out", buf);
|
||||
snprintf (buf, sizeof(buf), "%" PRIu64, _in->id());
|
||||
_in->id().print (buf);
|
||||
node->add_property ("in", buf);
|
||||
node->add_property ("active", (_active ? "yes" : "no"));
|
||||
node->add_property ("follow-overlap", (_follow_overlap ? "yes" : "no"));
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ DestructiveFileSource::DestructiveFileSource (string path, SampleFormat samp_for
|
|||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
file_pos = 0;
|
||||
|
||||
timeline_position = header_position_offset;
|
||||
AudioFileSource::HeaderPositionOffsetChanged.connect (mem_fun (*this, &DestructiveFileSource::handle_header_position_change));
|
||||
}
|
||||
|
||||
DestructiveFileSource::DestructiveFileSource (const XMLNode& node)
|
||||
|
|
@ -85,6 +88,9 @@ DestructiveFileSource::DestructiveFileSource (const XMLNode& node)
|
|||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
file_pos = 0;
|
||||
|
||||
timeline_position = header_position_offset;
|
||||
AudioFileSource::HeaderPositionOffsetChanged.connect (mem_fun (*this, &DestructiveFileSource::handle_header_position_change));
|
||||
}
|
||||
|
||||
DestructiveFileSource::~DestructiveFileSource()
|
||||
|
|
@ -124,8 +130,12 @@ DestructiveFileSource::setup_standard_crossfades (jack_nframes_t rate)
|
|||
void
|
||||
DestructiveFileSource::mark_capture_start (jack_nframes_t pos)
|
||||
{
|
||||
if (pos < timeline_position) {
|
||||
_capture_start = false;
|
||||
} else {
|
||||
_capture_start = true;
|
||||
capture_start_frame = pos;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -265,6 +275,11 @@ DestructiveFileSource::write_unlocked (Sample* data, jack_nframes_t cnt, char *
|
|||
}
|
||||
|
||||
if (_capture_start && _capture_end) {
|
||||
|
||||
/* start and end of capture both occur within the data we are writing,
|
||||
so do both crossfades.
|
||||
*/
|
||||
|
||||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
|
||||
|
|
@ -290,8 +305,12 @@ DestructiveFileSource::write_unlocked (Sample* data, jack_nframes_t cnt, char *
|
|||
}
|
||||
|
||||
file_pos = ofilepos; // adjusted below
|
||||
}
|
||||
else if (_capture_start) {
|
||||
|
||||
} else if (_capture_start) {
|
||||
|
||||
/* start of capture both occur within the data we are writing,
|
||||
so do the fade in
|
||||
*/
|
||||
|
||||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
|
|
@ -305,6 +324,10 @@ DestructiveFileSource::write_unlocked (Sample* data, jack_nframes_t cnt, char *
|
|||
|
||||
} else if (_capture_end) {
|
||||
|
||||
/* end of capture both occur within the data we are writing,
|
||||
so do the fade out
|
||||
*/
|
||||
|
||||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
|
||||
|
|
@ -314,6 +337,8 @@ DestructiveFileSource::write_unlocked (Sample* data, jack_nframes_t cnt, char *
|
|||
|
||||
} else {
|
||||
|
||||
/* in the middle of recording */
|
||||
|
||||
if (write_float (data, file_pos, cnt) != cnt) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -365,9 +390,20 @@ DestructiveFileSource::get_state ()
|
|||
return node;
|
||||
}
|
||||
|
||||
void
|
||||
DestructiveFileSource::handle_header_position_change ()
|
||||
{
|
||||
if ( _length != 0 ) {
|
||||
error << string_compose(_("Filesource: start time is already set for existing file (%1): Cannot change start time."), _path ) << endmsg;
|
||||
//in the future, pop up a dialog here that allows user to regenerate file with new start offset
|
||||
} else if (writable()) {
|
||||
timeline_position = header_position_offset;
|
||||
set_header_timeline_position (); //this will get flushed if/when the file is recorded to
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DestructiveFileSource::set_timeline_position (jack_nframes_t pos)
|
||||
{
|
||||
/* destructive tracks always start at where our reference frame zero is */
|
||||
timeline_position = 0;
|
||||
//destructive track timeline postion does not change except at instantion or when header_position_offset (session start) changes
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,48 +63,24 @@ sigc::signal<void> Diskstream::DiskOverrun;
|
|||
sigc::signal<void> Diskstream::DiskUnderrun;
|
||||
|
||||
Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
|
||||
: _name (name)
|
||||
: deprecated_io_node(NULL)
|
||||
, _name (name)
|
||||
, _session (sess)
|
||||
{
|
||||
#if 0
|
||||
/* prevent any write sources from being created */
|
||||
|
||||
in_set_state = true;
|
||||
|
||||
init (flag);
|
||||
//use_new_playlist ();
|
||||
|
||||
in_set_state = false;
|
||||
DiskstreamCreated (this); /* EMIT SIGNAL */
|
||||
#endif
|
||||
}
|
||||
|
||||
Diskstream::Diskstream (Session& sess, const XMLNode& node)
|
||||
: _session (sess)
|
||||
: deprecated_io_node(NULL)
|
||||
, _session (sess)
|
||||
|
||||
{
|
||||
#if 0
|
||||
in_set_state = true;
|
||||
init (Recordable);
|
||||
|
||||
/*if (set_state (node)) {
|
||||
in_set_state = false;
|
||||
throw failed_constructor();
|
||||
}*/
|
||||
|
||||
in_set_state = false;
|
||||
|
||||
//if (destructive()) {
|
||||
// use_destructive_playlist ();
|
||||
//}
|
||||
DiskstreamCreated (this); /* EMIT SIGNAL */
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Diskstream::init (Flag f)
|
||||
{
|
||||
_id = new_id();
|
||||
_refcnt = 0;
|
||||
_flags = f;
|
||||
_io = 0;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <lrdf.h>
|
||||
|
||||
#include <pbd/error.h>
|
||||
#include <pbd/id.h>
|
||||
#include <pbd/strsplit.h>
|
||||
|
||||
#include <midi++/port.h>
|
||||
|
|
@ -198,6 +199,8 @@ ARDOUR::init (AudioEngine& engine, bool use_vst, bool try_optimization)
|
|||
|
||||
(void) bindtextdomain(PACKAGE, LOCALEDIR);
|
||||
|
||||
PBD::ID::init ();
|
||||
|
||||
Config = new Configuration;
|
||||
|
||||
if (Config->load_state ()) {
|
||||
|
|
@ -325,10 +328,15 @@ ARDOUR::cleanup ()
|
|||
return 0;
|
||||
}
|
||||
|
||||
ARDOUR::id_t
|
||||
ARDOUR::new_id ()
|
||||
|
||||
microseconds_t
|
||||
ARDOUR::get_microseconds ()
|
||||
{
|
||||
return get_uid();
|
||||
/* XXX need JACK to export its functionality */
|
||||
|
||||
struct timeval now;
|
||||
gettimeofday (&now, 0);
|
||||
return now.tv_sec * 1000000ULL + now.tv_usec;
|
||||
}
|
||||
|
||||
ARDOUR::Change
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ PluginInsert::state (bool full)
|
|||
node->add_property("id", string(buf));
|
||||
if (_plugins[0]->state_node_name() == "ladspa") {
|
||||
char buf[32];
|
||||
snprintf (buf, 31, "%ld", _plugins[0]->get_info().unique_id);
|
||||
snprintf (buf, sizeof (buf), "%ld", _plugins[0]->get_info().unique_id);
|
||||
node->add_property("unique-id", string(buf));
|
||||
}
|
||||
node->add_property("count", string_compose("%1", _plugins.size()));
|
||||
|
|
@ -780,18 +780,6 @@ PluginInsert::describe_parameter (uint32_t what)
|
|||
return _plugins[0]->describe_parameter (what);
|
||||
}
|
||||
|
||||
void
|
||||
PluginInsert::reset_midi_control (MIDI::Port* port, bool on)
|
||||
{
|
||||
_plugins[0]->reset_midi_control (port, on);
|
||||
}
|
||||
|
||||
void
|
||||
PluginInsert::send_all_midi_feedback ()
|
||||
{
|
||||
_plugins[0]->send_all_midi_feedback();
|
||||
}
|
||||
|
||||
jack_nframes_t
|
||||
PluginInsert::latency()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -74,17 +74,17 @@ sigc::signal<int> IO::PortsCreated;
|
|||
|
||||
Glib::StaticMutex IO::m_meter_signal_lock = GLIBMM_STATIC_MUTEX_INIT;
|
||||
|
||||
/* this is a default mapper of MIDI control values to a gain coefficient.
|
||||
others can be imagined. see IO::set_midi_to_gain_function().
|
||||
/* this is a default mapper of [0 .. 1.0] control values to a gain coefficient.
|
||||
others can be imagined.
|
||||
*/
|
||||
|
||||
static gain_t direct_midi_to_gain (double fract) {
|
||||
static gain_t direct_control_to_gain (double fract) {
|
||||
/* XXX Marcus writes: this doesn't seem right to me. but i don't have a better answer ... */
|
||||
/* this maxes at +6dB */
|
||||
return pow (2.0,(sqrt(sqrt(sqrt(fract)))*198.0-192.0)/6.0);
|
||||
}
|
||||
|
||||
static double direct_gain_to_midi (gain_t gain) {
|
||||
static double direct_gain_to_control (gain_t gain) {
|
||||
/* XXX Marcus writes: this doesn't seem right to me. but i don't have a better answer ... */
|
||||
if (gain == 0) return 0.0;
|
||||
|
||||
|
|
@ -97,11 +97,8 @@ static bool sort_ports_by_name (Port* a, Port* b)
|
|||
}
|
||||
|
||||
|
||||
/** The 'default_type' argument here isn't very good, but port creation is too
|
||||
* brufty and all over the place to make anything else feasible without massive
|
||||
* changes. The default typed passed is the type of port that will be created
|
||||
* by ensure_io and friends. This is a temporary compatibility hack to get
|
||||
* multiple data types off the gound and should be removed.
|
||||
/** @param default_type The type of port that will be created by ensure_io
|
||||
* and friends if no type is explicitly requested (to avoid breakage).
|
||||
*/
|
||||
IO::IO (Session& s, string name,
|
||||
int input_min, int input_max, int output_min, int output_max,
|
||||
|
|
@ -109,14 +106,13 @@ IO::IO (Session& s, string name,
|
|||
: _session (s),
|
||||
_name (name),
|
||||
_default_type(default_type),
|
||||
_midi_gain_control (*this, _session.midi_port()),
|
||||
_gain_control (*this),
|
||||
_gain_automation_curve (0.0, 2.0, 1.0),
|
||||
_input_minimum (input_min),
|
||||
_input_maximum (input_max),
|
||||
_output_minimum (output_min),
|
||||
_output_maximum (output_max)
|
||||
{
|
||||
_id = new_id();
|
||||
_panner = new Panner (name, _session);
|
||||
_gain = 1.0;
|
||||
_desired_gain = 1.0;
|
||||
|
|
@ -128,9 +124,6 @@ IO::IO (Session& s, string name,
|
|||
no_panner_reset = false;
|
||||
deferred_state = 0;
|
||||
|
||||
_midi_gain_control.midi_to_gain = direct_midi_to_gain;
|
||||
_midi_gain_control.gain_to_midi = direct_gain_to_midi;
|
||||
|
||||
apply_gain_automation = false;
|
||||
|
||||
last_automation_snapshot = 0;
|
||||
|
|
@ -1429,7 +1422,7 @@ XMLNode&
|
|||
IO::state (bool full_state)
|
||||
{
|
||||
XMLNode* node = new XMLNode (state_node_name);
|
||||
char buf[32];
|
||||
char buf[64];
|
||||
string str;
|
||||
bool need_ins = true;
|
||||
bool need_outs = true;
|
||||
|
|
@ -1437,7 +1430,7 @@ IO::state (bool full_state)
|
|||
Glib::Mutex::Lock lm (io_lock);
|
||||
|
||||
node->add_property("name", _name);
|
||||
snprintf (buf, sizeof(buf), "%" PRIu64, id());
|
||||
id().print (buf);
|
||||
node->add_property("id", buf);
|
||||
|
||||
str = "";
|
||||
|
|
@ -1531,22 +1524,6 @@ IO::state (bool full_state)
|
|||
|
||||
node->add_property ("iolimits", buf);
|
||||
|
||||
/* MIDI control */
|
||||
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte additional;
|
||||
XMLNode* midi_node = 0;
|
||||
XMLNode* child;
|
||||
|
||||
if (_midi_gain_control.get_control_info (chn, ev, additional)) {
|
||||
|
||||
midi_node = node->add_child ("MIDI");
|
||||
|
||||
child = midi_node->add_child ("gain");
|
||||
set_midi_node_info (child, ev, chn, additional);
|
||||
}
|
||||
|
||||
/* automation */
|
||||
|
||||
if (full_state) {
|
||||
|
|
@ -1615,7 +1592,6 @@ IO::set_state (const XMLNode& node)
|
|||
{
|
||||
const XMLProperty* prop;
|
||||
XMLNodeConstIterator iter;
|
||||
XMLNodeList midi_kids;
|
||||
LocaleGuard lg (X_("POSIX"));
|
||||
|
||||
/* force use of non-localized representation of decimal point,
|
||||
|
|
@ -1633,7 +1609,7 @@ IO::set_state (const XMLNode& node)
|
|||
}
|
||||
|
||||
if ((prop = node.property ("id")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &_id);
|
||||
_id = prop->value ();
|
||||
}
|
||||
|
||||
if ((prop = node.property ("iolimits")) != 0) {
|
||||
|
|
@ -1655,35 +1631,6 @@ IO::set_state (const XMLNode& node)
|
|||
}
|
||||
}
|
||||
|
||||
midi_kids = node.children ("MIDI");
|
||||
|
||||
for (iter = midi_kids.begin(); iter != midi_kids.end(); ++iter) {
|
||||
|
||||
XMLNodeList kids;
|
||||
XMLNodeConstIterator miter;
|
||||
XMLNode* child;
|
||||
|
||||
kids = (*iter)->children ();
|
||||
|
||||
for (miter = kids.begin(); miter != kids.end(); ++miter) {
|
||||
|
||||
child =* miter;
|
||||
|
||||
if (child->name() == "gain") {
|
||||
|
||||
MIDI::eventType ev = MIDI::on; /* initialize to keep gcc happy */
|
||||
MIDI::byte additional = 0; /* ditto */
|
||||
MIDI::channel_t chn = 0; /* ditto */
|
||||
|
||||
if (get_midi_node_info (child, ev, chn, additional)) {
|
||||
_midi_gain_control.set_control_type (chn, ev, additional);
|
||||
} else {
|
||||
error << string_compose(_("MIDI gain control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((prop = node.property ("automation-state")) != 0) {
|
||||
|
||||
long int x;
|
||||
|
|
@ -1801,50 +1748,6 @@ IO::create_ports (const XMLNode& node)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
IO::get_midi_node_info (XMLNode * node, MIDI::eventType & ev, MIDI::channel_t & chan, MIDI::byte & additional)
|
||||
{
|
||||
bool ok = true;
|
||||
const XMLProperty* prop;
|
||||
int xx;
|
||||
|
||||
if ((prop = node->property ("event")) != 0) {
|
||||
sscanf (prop->value().c_str(), "0x%x", &xx);
|
||||
ev = (MIDI::eventType) xx;
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok && ((prop = node->property ("channel")) != 0)) {
|
||||
sscanf (prop->value().c_str(), "%d", &xx);
|
||||
chan = (MIDI::channel_t) xx;
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok && ((prop = node->property ("additional")) != 0)) {
|
||||
sscanf (prop->value().c_str(), "0x%x", &xx);
|
||||
additional = (MIDI::byte) xx;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
IO::set_midi_node_info (XMLNode * node, MIDI::eventType ev, MIDI::channel_t chan, MIDI::byte additional)
|
||||
{
|
||||
char buf[32];
|
||||
|
||||
snprintf (buf, sizeof(buf), "0x%x", ev);
|
||||
node->add_property ("event", buf);
|
||||
snprintf (buf, sizeof(buf), "%d", chan);
|
||||
node->add_property ("channel", buf);
|
||||
snprintf (buf, sizeof(buf), "0x%x", additional);
|
||||
node->add_property ("additional", buf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
IO::make_connections (const XMLNode& node)
|
||||
|
|
@ -2371,69 +2274,16 @@ IO::output_connection_configuration_changed ()
|
|||
use_output_connection (*_output_connection, this);
|
||||
}
|
||||
|
||||
IO::MIDIGainControl::MIDIGainControl (IO& i, MIDI::Port* port)
|
||||
: MIDI::Controllable (port, 0), io (i), setting(false)
|
||||
{
|
||||
midi_to_gain = 0;
|
||||
gain_to_midi = 0;
|
||||
setting = false;
|
||||
last_written = 0; /* XXX need a good out-of-bound-value */
|
||||
}
|
||||
|
||||
void
|
||||
IO::MIDIGainControl::set_value (float val)
|
||||
IO::GainControllable::set_value (float val)
|
||||
{
|
||||
if (midi_to_gain == 0) return;
|
||||
|
||||
setting = true;
|
||||
io.set_gain (midi_to_gain (val), this);
|
||||
setting = false;
|
||||
io.set_gain (direct_control_to_gain (val), this);
|
||||
}
|
||||
|
||||
void
|
||||
IO::MIDIGainControl::send_feedback (gain_t gain)
|
||||
float
|
||||
IO::GainControllable::get_value (void) const
|
||||
{
|
||||
if (!setting && get_midi_feedback() && gain_to_midi) {
|
||||
MIDI::byte val = (MIDI::byte) (gain_to_midi (gain) * 127.0);
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
MIDI::EventTwoBytes data;
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
data.controller_number = additional;
|
||||
data.value = val;
|
||||
last_written = val;
|
||||
|
||||
io._session.send_midi_message (get_port(), ev, ch, data);
|
||||
}
|
||||
//send_midi_feedback (gain_to_midi (gain));
|
||||
}
|
||||
}
|
||||
|
||||
MIDI::byte*
|
||||
IO::MIDIGainControl::write_feedback (MIDI::byte* buf, int32_t& bufsize, gain_t val, bool force)
|
||||
{
|
||||
if (get_midi_feedback() && gain_to_midi && bufsize > 2) {
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
MIDI::byte gm;
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
gm = (MIDI::byte) (gain_to_midi (val) * 127.0);
|
||||
|
||||
if (gm != last_written) {
|
||||
*buf++ = (0xF0 & ev) | (0xF & ch);
|
||||
*buf++ = additional; /* controller number */
|
||||
*buf++ = gm;
|
||||
last_written = gm;
|
||||
bufsize -= 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
return direct_gain_to_control (io.effective_gain());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2525,23 +2375,6 @@ IO::meter ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
IO::reset_midi_control (MIDI::Port* port, bool on)
|
||||
{
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte extra;
|
||||
|
||||
_midi_gain_control.get_control_info (chn, ev, extra);
|
||||
if (!on) {
|
||||
chn = -1;
|
||||
}
|
||||
_midi_gain_control.midi_rebind (port, chn);
|
||||
|
||||
_panner->reset_midi_control (port, on);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
IO::save_automation (const string& path)
|
||||
{
|
||||
|
|
@ -2731,10 +2564,7 @@ IO::set_gain (gain_t val, void *src)
|
|||
}
|
||||
|
||||
gain_changed (src);
|
||||
|
||||
if (_session.get_midi_feedback()) {
|
||||
_midi_gain_control.send_feedback (_desired_gain);
|
||||
}
|
||||
_gain_control.Changed (); /* EMIT SIGNAL */
|
||||
|
||||
if (_session.transport_stopped() && src != 0 && src != this && gain_automation_recording()) {
|
||||
_gain_automation_curve.add (_session.transport_frame(), val);
|
||||
|
|
@ -2744,30 +2574,6 @@ IO::set_gain (gain_t val, void *src)
|
|||
_session.set_dirty();
|
||||
}
|
||||
|
||||
void
|
||||
IO::send_all_midi_feedback ()
|
||||
{
|
||||
if (_session.get_midi_feedback()) {
|
||||
_midi_gain_control.send_feedback (_effective_gain);
|
||||
|
||||
// panners
|
||||
_panner->send_all_midi_feedback();
|
||||
}
|
||||
}
|
||||
|
||||
MIDI::byte*
|
||||
IO::write_midi_feedback (MIDI::byte* buf, int32_t& bufsize)
|
||||
{
|
||||
if (_session.get_midi_feedback()) {
|
||||
if (gain_automation_playback ()) {
|
||||
buf = _midi_gain_control.write_feedback (buf, bufsize, _effective_gain);
|
||||
}
|
||||
buf = _panner->write_midi_feedback (buf, bufsize);
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
void
|
||||
IO::start_gain_touch ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -133,20 +133,9 @@ LadspaPlugin::init (void *mod, uint32_t index, jack_nframes_t rate)
|
|||
}
|
||||
}
|
||||
|
||||
Plugin::setup_midi_controls ();
|
||||
Plugin::setup_controls ();
|
||||
|
||||
latency_compute_run ();
|
||||
|
||||
MIDI::Controllable *mcontrol;
|
||||
|
||||
for (uint32_t i = 0; i < parameter_count(); ++i) {
|
||||
if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) &&
|
||||
LADSPA_IS_PORT_CONTROL(port_descriptor (i))) {
|
||||
if ((mcontrol = get_nth_midi_control (i)) != 0) {
|
||||
mcontrol->midi_rebind (_session.midi_port(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LadspaPlugin::~LadspaPlugin ()
|
||||
|
|
@ -318,11 +307,8 @@ LadspaPlugin::set_parameter (uint32_t which, float val)
|
|||
shadow_data[which] = (LADSPA_Data) val;
|
||||
ParameterChanged (which, val); /* EMIT SIGNAL */
|
||||
|
||||
if (session().get_midi_feedback()) {
|
||||
|
||||
if (which < parameter_count() && midi_controls[which]) {
|
||||
midi_controls[which]->send_feedback (val);
|
||||
}
|
||||
if (which < parameter_count() && controls[which]) {
|
||||
controls[which]->Changed ();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -380,28 +366,6 @@ LadspaPlugin::get_state()
|
|||
snprintf(buf, sizeof(buf), "%+f", shadow_data[i]);
|
||||
child->add_property("value", string(buf));
|
||||
root->add_child_nocopy (*child);
|
||||
|
||||
MIDI::Controllable *pcontrol = get_nth_midi_control (i);
|
||||
|
||||
if (pcontrol) {
|
||||
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte additional;
|
||||
MIDI::channel_t chn;
|
||||
XMLNode* midi_node;
|
||||
|
||||
if (pcontrol->get_control_info (chn, ev, additional)) {
|
||||
|
||||
midi_node = child->add_child ("midi-control");
|
||||
|
||||
snprintf (buf, sizeof(buf), "0x%x", ev);
|
||||
midi_node->add_property ("event", buf);
|
||||
snprintf (buf, sizeof(buf), "%d", chn);
|
||||
midi_node->add_property ("channel", buf);
|
||||
snprintf (buf, sizeof(buf), "0x%x", additional);
|
||||
midi_node->add_property ("additional", buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -452,52 +416,6 @@ LadspaPlugin::set_state(const XMLNode& node)
|
|||
|
||||
sscanf (port, "%" PRIu32, &port_id);
|
||||
set_parameter (port_id, atof(data));
|
||||
|
||||
XMLNodeList midi_kids;
|
||||
XMLNodeConstIterator iter;
|
||||
|
||||
midi_kids = child->children ("midi-control");
|
||||
|
||||
for (iter = midi_kids.begin(); iter != midi_kids.end(); ++iter) {
|
||||
|
||||
child = *iter;
|
||||
|
||||
MIDI::eventType ev = MIDI::on; /* initialize to keep gcc happy */
|
||||
MIDI::byte additional = 0; /* initialize to keep gcc happy */
|
||||
MIDI::channel_t chn = 0; /* initialize to keep gcc happy */
|
||||
bool ok = true;
|
||||
int xx;
|
||||
|
||||
if ((prop = child->property ("event")) != 0) {
|
||||
sscanf (prop->value().c_str(), "0x%x", &xx);
|
||||
ev = (MIDI::eventType) xx;
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok && ((prop = child->property ("channel")) != 0)) {
|
||||
sscanf (prop->value().c_str(), "%d", &xx);
|
||||
chn = (MIDI::channel_t) xx;
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok && ((prop = child->property ("additional")) != 0)) {
|
||||
sscanf (prop->value().c_str(), "0x%x", &xx);
|
||||
additional = (MIDI::byte) xx;
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
MIDI::Controllable* pcontrol = get_nth_midi_control (port_id);
|
||||
|
||||
if (pcontrol) {
|
||||
pcontrol->set_control_type (chn, ev, additional);
|
||||
}
|
||||
|
||||
} else {
|
||||
error << string_compose(_("LADSPA LadspaPlugin MIDI control specification for port %1 is incomplete, so it has been ignored"), port) << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
latency_compute_run ();
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <pbd/xml++.h>
|
||||
|
||||
#include <ardour/location.h>
|
||||
#include <ardour/audiofilesource.h>
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
|
@ -44,6 +45,10 @@ Location::Location (const Location& other)
|
|||
_end (other._end),
|
||||
_flags (other._flags)
|
||||
{
|
||||
/* start and end flags can never be copied, because there can only ever be one of each */
|
||||
|
||||
_flags = Flags (_flags & ~IsStart);
|
||||
_flags = Flags (_flags & ~IsEnd);
|
||||
}
|
||||
|
||||
Location*
|
||||
|
|
@ -71,6 +76,9 @@ Location::set_start (jack_nframes_t s)
|
|||
_start = s;
|
||||
_end = s;
|
||||
start_changed(this); /* EMIT SIGNAL */
|
||||
if ( is_start() ) {
|
||||
AudioFileSource::set_header_position_offset ( s );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ MidiDiskstream::MidiDiskstream (Session &sess, const string &name, Diskstream::F
|
|||
|
||||
in_set_state = true;
|
||||
|
||||
init (flag);
|
||||
init(flag);
|
||||
use_new_playlist ();
|
||||
|
||||
in_set_state = false;
|
||||
|
|
@ -432,7 +432,7 @@ MidiDiskstream::get_state ()
|
|||
node->add_property ("speed", buf);
|
||||
|
||||
node->add_property("name", _name);
|
||||
snprintf (buf, sizeof(buf), "%" PRIu64, id());
|
||||
id().print(buf);
|
||||
node->add_property("id", buf);
|
||||
|
||||
if (!_capturing_sources.empty() && _session.get_record_enabled()) {
|
||||
|
|
@ -499,11 +499,11 @@ MidiDiskstream::set_state (const XMLNode& node)
|
|||
|
||||
if (deprecated_io_node) {
|
||||
if ((prop = deprecated_io_node->property ("id")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &_id);
|
||||
_id = prop->value ();
|
||||
}
|
||||
} else {
|
||||
if ((prop = node.property ("id")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &_id);
|
||||
_id = prop->value ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,11 +37,12 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
MidiTrack::MidiTrack (Session& sess, string name, Route::Flag flag, TrackMode mode)
|
||||
: Route (sess, name, 1, -1, -1, -1, flag, Buffer::MIDI),
|
||||
diskstream (0),
|
||||
_midi_rec_enable_control (*this, _session.midi_port())
|
||||
_diskstream (0),
|
||||
_rec_enable_control (*this)
|
||||
{
|
||||
MidiDiskstream::Flag dflags = MidiDiskstream::Flag (0);
|
||||
|
||||
|
|
@ -63,32 +64,23 @@ MidiTrack::MidiTrack (Session& sess, string name, Route::Flag flag, TrackMode mo
|
|||
_mode = mode;
|
||||
|
||||
set_diskstream (*ds, this);
|
||||
|
||||
// session.SMPTEOffsetChanged.connect (mem_fun (*this, &MidiTrack::handle_smpte_offset_change));
|
||||
|
||||
// we do this even though Route already did it in it's init
|
||||
reset_midi_control (_session.midi_port(), _session.get_midi_control());
|
||||
|
||||
}
|
||||
|
||||
MidiTrack::MidiTrack (Session& sess, const XMLNode& node)
|
||||
: Route (sess, "to be renamed", 0, 0, -1, -1),
|
||||
diskstream (0),
|
||||
_midi_rec_enable_control (*this, _session.midi_port())
|
||||
_diskstream (0),
|
||||
_rec_enable_control (*this)
|
||||
{
|
||||
_freeze_record.state = NoFreeze;
|
||||
set_state (node);
|
||||
_declickable = true;
|
||||
_saved_meter_point = _meter_point;
|
||||
|
||||
// we do this even though Route already did it in it's init
|
||||
reset_midi_control (_session.midi_port(), _session.get_midi_control());
|
||||
}
|
||||
|
||||
MidiTrack::~MidiTrack ()
|
||||
{
|
||||
if (diskstream) {
|
||||
diskstream->unref();
|
||||
if (_diskstream) {
|
||||
_diskstream->unref();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -103,16 +95,16 @@ MidiTrack::handle_smpte_offset_change ()
|
|||
int
|
||||
MidiTrack::deprecated_use_diskstream_connections ()
|
||||
{
|
||||
if (diskstream->deprecated_io_node == 0) {
|
||||
if (_diskstream->deprecated_io_node == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const XMLProperty* prop;
|
||||
XMLNode& node (*diskstream->deprecated_io_node);
|
||||
XMLNode& node (*_diskstream->deprecated_io_node);
|
||||
|
||||
/* don't do this more than once. */
|
||||
|
||||
diskstream->deprecated_io_node = 0;
|
||||
_diskstream->deprecated_io_node = 0;
|
||||
|
||||
set_input_minimum (-1);
|
||||
set_input_maximum (-1);
|
||||
|
|
@ -155,15 +147,15 @@ MidiTrack::deprecated_use_diskstream_connections ()
|
|||
int
|
||||
MidiTrack::set_diskstream (MidiDiskstream& ds, void *src)
|
||||
{
|
||||
if (diskstream) {
|
||||
diskstream->unref();
|
||||
if (_diskstream) {
|
||||
_diskstream->unref();
|
||||
}
|
||||
|
||||
diskstream = &ds.ref();
|
||||
diskstream->set_io (*this);
|
||||
diskstream->set_destructive (_mode == Destructive);
|
||||
_diskstream = &ds.ref();
|
||||
_diskstream->set_io (*this);
|
||||
_diskstream->set_destructive (_mode == Destructive);
|
||||
|
||||
if (diskstream->deprecated_io_node) {
|
||||
if (_diskstream->deprecated_io_node) {
|
||||
|
||||
if (!connecting_legal) {
|
||||
ConnectingLegal.connect (mem_fun (*this, &MidiTrack::deprecated_use_diskstream_connections));
|
||||
|
|
@ -172,11 +164,11 @@ MidiTrack::set_diskstream (MidiDiskstream& ds, void *src)
|
|||
}
|
||||
}
|
||||
|
||||
diskstream->set_record_enabled (false, this);
|
||||
//diskstream->monitor_input (false);
|
||||
_diskstream->set_record_enabled (false, this);
|
||||
//_diskstream->monitor_input (false);
|
||||
|
||||
ic_connection.disconnect();
|
||||
ic_connection = input_changed.connect (mem_fun (*diskstream, &MidiDiskstream::handle_input_change));
|
||||
ic_connection = input_changed.connect (mem_fun (*_diskstream, &MidiDiskstream::handle_input_change));
|
||||
|
||||
diskstream_changed (src); /* EMIT SIGNAL */
|
||||
|
||||
|
|
@ -189,34 +181,30 @@ MidiTrack::use_diskstream (string name)
|
|||
MidiDiskstream *dstream;
|
||||
|
||||
if ((dstream = dynamic_cast<MidiDiskstream*>(_session.diskstream_by_name (name))) == 0) {
|
||||
PBD::error << string_compose(_("MidiTrack: diskstream \"%1\" not known by session"), name) << endmsg;
|
||||
error << string_compose(_("MidiTrack: midi diskstream \"%1\" not known by session"), name) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return set_diskstream (*dstream, this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
MidiTrack::use_diskstream (id_t id)
|
||||
MidiTrack::use_diskstream (const PBD::ID& id)
|
||||
{
|
||||
MidiDiskstream *dstream;
|
||||
|
||||
if ((dstream = dynamic_cast<MidiDiskstream*>(_session.diskstream_by_id (id))) == 0) {
|
||||
PBD::error << string_compose(_("MidiTrack: diskstream \"%1\" not known by session"), id) << endmsg;
|
||||
error << string_compose(_("MidiTrack: midi diskstream \"%1\" not known by session"), id) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return set_diskstream (*dstream, this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
MidiTrack::record_enabled () const
|
||||
{
|
||||
return diskstream->record_enabled ();
|
||||
return _diskstream->record_enabled ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -262,7 +250,6 @@ MidiTrack::set_state (const XMLNode& node)
|
|||
{
|
||||
const XMLProperty *prop;
|
||||
XMLNodeConstIterator iter;
|
||||
XMLNodeList midi_kids;
|
||||
|
||||
if (Route::set_state (node)) {
|
||||
return -1;
|
||||
|
|
@ -274,49 +261,19 @@ MidiTrack::set_state (const XMLNode& node)
|
|||
} else if (prop->value() == X_("destructive")) {
|
||||
_mode = Destructive;
|
||||
} else {
|
||||
PBD::warning << string_compose ("unknown midi track mode \"%1\" seen and ignored", prop->value()) << endmsg;
|
||||
warning << string_compose ("unknown midi track mode \"%1\" seen and ignored", prop->value()) << endmsg;
|
||||
_mode = Normal;
|
||||
}
|
||||
} else {
|
||||
_mode = Normal;
|
||||
}
|
||||
|
||||
midi_kids = node.children ("MIDI");
|
||||
|
||||
for (iter = midi_kids.begin(); iter != midi_kids.end(); ++iter) {
|
||||
|
||||
XMLNodeList kids;
|
||||
XMLNodeConstIterator miter;
|
||||
XMLNode* child;
|
||||
|
||||
kids = (*iter)->children ();
|
||||
|
||||
for (miter = kids.begin(); miter != kids.end(); ++miter) {
|
||||
|
||||
child =* miter;
|
||||
|
||||
if (child->name() == "rec_enable") {
|
||||
|
||||
MIDI::eventType ev = MIDI::on; /* initialize to keep gcc happy */
|
||||
MIDI::byte additional = 0; /* ditto */
|
||||
MIDI::channel_t chn = 0; /* ditto */
|
||||
|
||||
if (get_midi_node_info (child, ev, chn, additional)) {
|
||||
_midi_rec_enable_control.set_control_type (chn, ev, additional);
|
||||
} else {
|
||||
PBD::error << string_compose(_("MIDI rec_enable control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((prop = node.property ("diskstream-id")) == 0) {
|
||||
|
||||
/* some old sessions use the diskstream name rather than the ID */
|
||||
|
||||
if ((prop = node.property ("diskstream")) == 0) {
|
||||
PBD::fatal << _("programming error: MidiTrack given state without diskstream!") << endmsg;
|
||||
fatal << _("programming error: MidiTrack given state without diskstream!") << endmsg;
|
||||
/*NOTREACHED*/
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -327,7 +284,7 @@ MidiTrack::set_state (const XMLNode& node)
|
|||
|
||||
} else {
|
||||
|
||||
id_t id = strtoull (prop->value().c_str(), 0, 10);
|
||||
PBD::ID id (prop->value());
|
||||
|
||||
if (use_diskstream (id)) {
|
||||
return -1;
|
||||
|
|
@ -376,7 +333,7 @@ MidiTrack::state(bool full_state)
|
|||
{
|
||||
XMLNode& root (Route::state(full_state));
|
||||
XMLNode* freeze_node;
|
||||
char buf[32];
|
||||
char buf[64];
|
||||
|
||||
if (_freeze_record.playlist) {
|
||||
XMLNode* inode;
|
||||
|
|
@ -388,7 +345,7 @@ MidiTrack::state(bool full_state)
|
|||
|
||||
for (vector<FreezeRecordInsertInfo*>::iterator i = _freeze_record.insert_info.begin(); i != _freeze_record.insert_info.end(); ++i) {
|
||||
inode = new XMLNode (X_("insert"));
|
||||
snprintf (buf, sizeof (buf), "%" PRIu64, (*i)->id);
|
||||
(*i)->id.print (buf);
|
||||
inode->add_property (X_("id"), buf);
|
||||
inode->add_child_copy ((*i)->state);
|
||||
|
||||
|
|
@ -401,7 +358,7 @@ MidiTrack::state(bool full_state)
|
|||
/* Alignment: act as a proxy for the diskstream */
|
||||
|
||||
XMLNode* align_node = new XMLNode (X_("alignment"));
|
||||
switch (diskstream->alignment_style()) {
|
||||
switch (_diskstream->alignment_style()) {
|
||||
case ExistingMaterial:
|
||||
snprintf (buf, sizeof (buf), X_("existing"));
|
||||
break;
|
||||
|
|
@ -412,29 +369,6 @@ MidiTrack::state(bool full_state)
|
|||
align_node->add_property (X_("style"), buf);
|
||||
root.add_child_nocopy (*align_node);
|
||||
|
||||
/* MIDI control */
|
||||
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte additional;
|
||||
XMLNode* midi_node = 0;
|
||||
XMLNode* child;
|
||||
XMLNodeList midikids;
|
||||
|
||||
midikids = root.children ("MIDI");
|
||||
if (!midikids.empty()) {
|
||||
midi_node = midikids.front();
|
||||
}
|
||||
else {
|
||||
midi_node = root.add_child ("MIDI");
|
||||
}
|
||||
|
||||
if (_midi_rec_enable_control.get_control_info (chn, ev, additional) && midi_node) {
|
||||
|
||||
child = midi_node->add_child ("rec_enable");
|
||||
set_midi_node_info (child, ev, chn, additional);
|
||||
}
|
||||
|
||||
XMLNode* remote_control_node = new XMLNode (X_("remote_control"));
|
||||
snprintf (buf, sizeof (buf), "%d", _remote_control_id);
|
||||
remote_control_node->add_property (X_("id"), buf);
|
||||
|
|
@ -455,7 +389,7 @@ MidiTrack::state(bool full_state)
|
|||
diskstream.
|
||||
*/
|
||||
|
||||
snprintf (buf, sizeof (buf), "%" PRIu64, diskstream->id());
|
||||
_diskstream->id().print (buf);
|
||||
root.add_property ("diskstream-id", buf);
|
||||
|
||||
return root;
|
||||
|
|
@ -516,7 +450,7 @@ MidiTrack::set_state_part_two ()
|
|||
|
||||
FreezeRecordInsertInfo* frii = new FreezeRecordInsertInfo (*((*citer)->children().front()));
|
||||
frii->insert = 0;
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &frii->id);
|
||||
frii->id = prop->value ();
|
||||
_freeze_record.insert_info.push_back (frii);
|
||||
}
|
||||
}
|
||||
|
|
@ -527,9 +461,9 @@ MidiTrack::set_state_part_two ()
|
|||
|
||||
if ((prop = fnode->property (X_("style"))) != 0) {
|
||||
if (prop->value() == "existing") {
|
||||
diskstream->set_persistent_align_style (ExistingMaterial);
|
||||
_diskstream->set_persistent_align_style (ExistingMaterial);
|
||||
} else if (prop->value() == "capture") {
|
||||
diskstream->set_persistent_align_style (CaptureTime);
|
||||
_diskstream->set_persistent_align_style (CaptureTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -539,7 +473,7 @@ MidiTrack::set_state_part_two ()
|
|||
uint32_t
|
||||
MidiTrack::n_process_buffers ()
|
||||
{
|
||||
return max ((uint32_t) diskstream->n_channels(), redirect_max_outs);
|
||||
return max ((uint32_t) _diskstream->n_channels(), redirect_max_outs);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -570,7 +504,7 @@ MidiTrack::no_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nfr
|
|||
return 0;
|
||||
}
|
||||
|
||||
diskstream->check_record_status (start_frame, nframes, can_record);
|
||||
_diskstream->check_record_status (start_frame, nframes, can_record);
|
||||
|
||||
bool send_silence;
|
||||
|
||||
|
|
@ -589,7 +523,7 @@ MidiTrack::no_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nfr
|
|||
send_silence = true;
|
||||
}
|
||||
} else {
|
||||
if (diskstream->record_enabled()) {
|
||||
if (_diskstream->record_enabled()) {
|
||||
if (Config->get_use_sw_monitoring()) {
|
||||
send_silence = false;
|
||||
} else {
|
||||
|
|
@ -759,7 +693,7 @@ MidiTrack::silent_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack
|
|||
|
||||
silence (nframes, offset);
|
||||
|
||||
return diskstream->process (_session.transport_frame() + offset, nframes, offset, can_record, rec_monitors_input);
|
||||
return _diskstream->process (_session.transport_frame() + offset, nframes, offset, can_record, rec_monitors_input);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -780,7 +714,7 @@ MidiTrack::set_name (string str, void *src)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (diskstream->set_name (str, src)) {
|
||||
if (_diskstream->set_name (str, src)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -893,7 +827,7 @@ void
|
|||
MidiTrack::set_latency_delay (jack_nframes_t longest_session_latency)
|
||||
{
|
||||
Route::set_latency_delay (longest_session_latency);
|
||||
diskstream->set_roll_delay (_roll_delay);
|
||||
_diskstream->set_roll_delay (_roll_delay);
|
||||
}
|
||||
|
||||
jack_nframes_t
|
||||
|
|
@ -1064,101 +998,32 @@ MidiTrack::freeze_state() const
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
MidiTrack::reset_midi_control (MIDI::Port* port, bool on)
|
||||
MidiTrack::MIDIRecEnableControllable::MIDIRecEnableControllable (MidiTrack& s)
|
||||
: track(s)
|
||||
{
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte extra;
|
||||
|
||||
Route::reset_midi_control (port, on);
|
||||
|
||||
_midi_rec_enable_control.get_control_info (chn, ev, extra);
|
||||
if (!on) {
|
||||
chn = -1;
|
||||
}
|
||||
_midi_rec_enable_control.midi_rebind (port, chn);
|
||||
}
|
||||
|
||||
void
|
||||
MidiTrack::send_all_midi_feedback ()
|
||||
{
|
||||
if (_session.get_midi_feedback()) {
|
||||
|
||||
Route::send_all_midi_feedback();
|
||||
|
||||
_midi_rec_enable_control.send_feedback (record_enabled());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MidiTrack::MIDIRecEnableControl::MIDIRecEnableControl (MidiTrack& s, MIDI::Port* port)
|
||||
: MIDI::Controllable (port, 0), track (s), setting(false)
|
||||
{
|
||||
last_written = false; /* XXX need a good out of bound value */
|
||||
}
|
||||
|
||||
void
|
||||
MidiTrack::MIDIRecEnableControl::set_value (float val)
|
||||
MidiTrack::MIDIRecEnableControllable::set_value (float val)
|
||||
{
|
||||
bool bval = ((val >= 0.5f) ? true: false);
|
||||
|
||||
setting = true;
|
||||
track.set_record_enable (bval, this);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void
|
||||
MidiTrack::MIDIRecEnableControl::send_feedback (bool value)
|
||||
float
|
||||
MidiTrack::MIDIRecEnableControllable::get_value (void) const
|
||||
{
|
||||
|
||||
if (!setting && get_midi_feedback()) {
|
||||
MIDI::byte val = (MIDI::byte) (value ? 127: 0);
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
MIDI::EventTwoBytes data;
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
data.controller_number = additional;
|
||||
data.value = val;
|
||||
|
||||
track._session.send_midi_message (get_port(), ev, ch, data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MIDI::byte*
|
||||
MidiTrack::MIDIRecEnableControl::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool val, bool force)
|
||||
{
|
||||
if (get_midi_feedback()) {
|
||||
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
if (val != last_written || force) {
|
||||
*buf++ = ev & ch;
|
||||
*buf++ = additional; /* controller number */
|
||||
*buf++ = (MIDI::byte) (val ? 127: 0);
|
||||
last_written = val;
|
||||
bufsize -= 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
if (track.record_enabled()) { return 1.0f; }
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
MidiTrack::set_mode (TrackMode m)
|
||||
{
|
||||
if (diskstream) {
|
||||
if (_diskstream) {
|
||||
if (_mode != m) {
|
||||
_mode = m;
|
||||
diskstream->set_destructive (m == Destructive);
|
||||
_diskstream->set_destructive (m == Destructive);
|
||||
ModeChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,21 +53,21 @@ float Panner::current_automation_version_number = 1.0;
|
|||
string EqualPowerStereoPanner::name = "Equal Power Stereo";
|
||||
string Multi2dPanner::name = "Multiple (2D)";
|
||||
|
||||
/* this is a default mapper of MIDI control values to a pan position
|
||||
others can be imagined. see Panner::set_midi_to_pan_function().
|
||||
/* this is a default mapper of control values to a pan position
|
||||
others can be imagined.
|
||||
*/
|
||||
|
||||
static pan_t direct_midi_to_pan (double fract) {
|
||||
static pan_t direct_control_to_pan (double fract) {
|
||||
return fract;
|
||||
}
|
||||
|
||||
static double direct_pan_to_midi (pan_t val) {
|
||||
static double direct_pan_to_control (pan_t val) {
|
||||
return val;
|
||||
}
|
||||
|
||||
StreamPanner::StreamPanner (Panner& p)
|
||||
: parent (p),
|
||||
_midi_control (*this, (MIDI::Port*) 0)
|
||||
_control (*this)
|
||||
{
|
||||
_muted = false;
|
||||
|
||||
|
|
@ -80,84 +80,30 @@ StreamPanner::~StreamPanner ()
|
|||
{
|
||||
}
|
||||
|
||||
StreamPanner::MIDIControl::MIDIControl (StreamPanner& s, MIDI::Port* port)
|
||||
: MIDI::Controllable (port, 0), sp (s), setting(false)
|
||||
{
|
||||
midi_to_pan = direct_midi_to_pan;
|
||||
pan_to_midi = direct_pan_to_midi;
|
||||
last_written = 0; /* XXX need a good out-of-bound-value */
|
||||
}
|
||||
|
||||
void
|
||||
StreamPanner::MIDIControl::set_value (float val)
|
||||
StreamPanner::PanControllable::set_value (float val)
|
||||
{
|
||||
setting = true;
|
||||
sp.set_position (midi_to_pan (val));
|
||||
setting = false;
|
||||
panner.set_position (direct_control_to_pan (val));
|
||||
}
|
||||
|
||||
void
|
||||
StreamPanner::MIDIControl::send_feedback (pan_t value)
|
||||
float
|
||||
StreamPanner::PanControllable::get_value (void) const
|
||||
{
|
||||
|
||||
if (!setting && get_midi_feedback() && pan_to_midi) {
|
||||
MIDI::byte val = (MIDI::byte) (pan_to_midi (value) * 127.0f);
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
MIDI::EventTwoBytes data;
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
data.controller_number = additional;
|
||||
data.value = val;
|
||||
last_written = val;
|
||||
|
||||
sp.get_parent().session().send_midi_message (get_port(), ev, ch, data);
|
||||
}
|
||||
|
||||
// send_midi_feedback (pan_to_midi (val));
|
||||
}
|
||||
|
||||
float xpos;
|
||||
panner.get_effective_position (xpos);
|
||||
return direct_pan_to_control (xpos);
|
||||
}
|
||||
|
||||
MIDI::byte*
|
||||
StreamPanner::MIDIControl::write_feedback (MIDI::byte* buf, int32_t& bufsize, pan_t val, bool force)
|
||||
bool
|
||||
StreamPanner::PanControllable::can_send_feedback () const
|
||||
{
|
||||
if (get_midi_feedback() && pan_to_midi && bufsize > 2) {
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
MIDI::byte pm;
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
AutoState astate = panner.get_parent().automation_state ();
|
||||
|
||||
pm = (MIDI::byte) (pan_to_midi (val) * 127.0);
|
||||
|
||||
if (pm != last_written || force) {
|
||||
*buf++ = (0xF0 & ev) | (0xF & ch);
|
||||
*buf++ = additional; /* controller number */
|
||||
*buf++ = pm;
|
||||
last_written = pm;
|
||||
bufsize -= 3;
|
||||
}
|
||||
}
|
||||
if ((astate == Play) || (astate == Touch && !panner.get_parent().touching())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StreamPanner::reset_midi_control (MIDI::Port* port, bool on)
|
||||
{
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte extra;
|
||||
|
||||
_midi_control.get_control_info (chn, ev, extra);
|
||||
if (!on) {
|
||||
chn = -1;
|
||||
}
|
||||
_midi_control.midi_rebind (port, chn);
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -180,10 +126,7 @@ StreamPanner::set_position (float xpos, bool link_call)
|
|||
x = xpos;
|
||||
update ();
|
||||
Changed ();
|
||||
|
||||
if (parent.session().get_midi_feedback()) {
|
||||
_midi_control.send_feedback (x);
|
||||
}
|
||||
_control.Changed ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -224,42 +167,11 @@ StreamPanner::set_state (const XMLNode& node)
|
|||
{
|
||||
const XMLProperty* prop;
|
||||
XMLNodeConstIterator iter;
|
||||
XMLNodeList midi_kids;
|
||||
|
||||
if ((prop = node.property (X_("muted")))) {
|
||||
set_muted (prop->value() == "yes");
|
||||
}
|
||||
|
||||
midi_kids = node.children ("MIDI");
|
||||
|
||||
for (iter = midi_kids.begin(); iter != midi_kids.end(); ++iter) {
|
||||
|
||||
XMLNodeList kids;
|
||||
XMLNodeConstIterator miter;
|
||||
XMLNode* child;
|
||||
|
||||
kids = (*iter)->children ();
|
||||
|
||||
for (miter = kids.begin(); miter != kids.end(); ++miter) {
|
||||
|
||||
child =* miter;
|
||||
|
||||
if (child->name() == "pan") {
|
||||
|
||||
MIDI::eventType ev = MIDI::on; /* initialize to keep gcc happy */
|
||||
MIDI::byte additional = 0; /* ditto */
|
||||
MIDI::channel_t chn = 0; /* ditto */
|
||||
|
||||
if (get_midi_node_info (child, ev, chn, additional)) {
|
||||
_midi_control.set_control_type (chn, ev, additional);
|
||||
} else {
|
||||
error << _("MIDI pan control specification is incomplete, so it has been ignored") << endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -267,68 +179,6 @@ void
|
|||
StreamPanner::add_state (XMLNode& node)
|
||||
{
|
||||
node.add_property (X_("muted"), (muted() ? "yes" : "no"));
|
||||
|
||||
/* MIDI control */
|
||||
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte additional;
|
||||
XMLNode* midi_node = 0;
|
||||
XMLNode* child;
|
||||
|
||||
if (_midi_control.get_control_info (chn, ev, additional)) {
|
||||
|
||||
midi_node = node.add_child ("MIDI");
|
||||
|
||||
child = midi_node->add_child ("pan");
|
||||
set_midi_node_info (child, ev, chn, additional);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
StreamPanner::get_midi_node_info (XMLNode * node, MIDI::eventType & ev, MIDI::channel_t & chan, MIDI::byte & additional)
|
||||
{
|
||||
bool ok = true;
|
||||
const XMLProperty* prop;
|
||||
int xx;
|
||||
|
||||
if ((prop = node->property ("event")) != 0) {
|
||||
sscanf (prop->value().c_str(), "0x%x", &xx);
|
||||
ev = (MIDI::eventType) xx;
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok && ((prop = node->property ("channel")) != 0)) {
|
||||
sscanf (prop->value().c_str(), "%d", &xx);
|
||||
chan = (MIDI::channel_t) xx;
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok && ((prop = node->property ("additional")) != 0)) {
|
||||
sscanf (prop->value().c_str(), "0x%x", &xx);
|
||||
additional = (MIDI::byte) xx;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
StreamPanner::set_midi_node_info (XMLNode * node, MIDI::eventType ev, MIDI::channel_t chan, MIDI::byte additional)
|
||||
{
|
||||
char buf[32];
|
||||
|
||||
snprintf (buf, sizeof(buf), "0x%x", ev);
|
||||
node->add_property ("event", buf);
|
||||
snprintf (buf, sizeof(buf), "%d", chan);
|
||||
node->add_property ("channel", buf);
|
||||
snprintf (buf, sizeof(buf), "0x%x", additional);
|
||||
node->add_property ("additional", buf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------- */
|
||||
|
|
@ -959,8 +809,6 @@ Panner::Panner (string name, Session& s)
|
|||
_linked = false;
|
||||
_link_direction = SameDirection;
|
||||
_bypassed = false;
|
||||
|
||||
reset_midi_control (_session.mmc_port(), _session.get_mmc_control());
|
||||
}
|
||||
|
||||
Panner::~Panner ()
|
||||
|
|
@ -1107,8 +955,6 @@ Panner::reset (uint32_t nouts, uint32_t npans)
|
|||
(*x)->update ();
|
||||
}
|
||||
|
||||
reset_midi_control (_session.mmc_port(), _session.get_mmc_control());
|
||||
|
||||
/* force hard left/right panning in a common case: 2in/2out
|
||||
*/
|
||||
|
||||
|
|
@ -1489,14 +1335,6 @@ Panner::touching () const
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
Panner::reset_midi_control (MIDI::Port* port, bool on)
|
||||
{
|
||||
for (vector<StreamPanner*>::const_iterator i = begin(); i != end(); ++i) {
|
||||
(*i)->reset_midi_control (port, on);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Panner::set_position (float xpos, StreamPanner& orig)
|
||||
{
|
||||
|
|
@ -1639,42 +1477,3 @@ Panner::set_position (float xpos, float ypos, float zpos, StreamPanner& orig)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Panner::send_all_midi_feedback ()
|
||||
{
|
||||
if (_session.get_midi_feedback()) {
|
||||
float xpos;
|
||||
|
||||
// do feedback for all panners
|
||||
for (vector<StreamPanner*>::iterator i = begin(); i != end(); ++i) {
|
||||
(*i)->get_effective_position (xpos);
|
||||
|
||||
(*i)->midi_control().send_feedback (xpos);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
MIDI::byte*
|
||||
Panner::write_midi_feedback (MIDI::byte* buf, int32_t& bufsize)
|
||||
{
|
||||
AutoState astate = automation_state ();
|
||||
|
||||
if (_session.get_midi_feedback() &&
|
||||
(astate == Play || (astate == Touch && !touching()))) {
|
||||
|
||||
float xpos;
|
||||
|
||||
// do feedback for all panners
|
||||
for (vector<StreamPanner*>::iterator i = begin(); i != end(); ++i) {
|
||||
(*i)->get_effective_position (xpos);
|
||||
|
||||
buf = (*i)->midi_control().write_feedback (buf, bufsize, xpos);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ Playlist::Playlist (Session& sess, string nom, bool hide)
|
|||
{
|
||||
init (hide);
|
||||
_name = nom;
|
||||
_orig_diskstream_id = 0;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +85,6 @@ Playlist::Playlist (Session& sess, const XMLNode& node, bool hide)
|
|||
{
|
||||
init (hide);
|
||||
_name = "unnamed"; /* reset by set_state */
|
||||
_orig_diskstream_id = 0;
|
||||
|
||||
if (set_state (node)) {
|
||||
throw failed_constructor();
|
||||
|
|
@ -1343,7 +1341,7 @@ Playlist::set_state (const XMLNode& node)
|
|||
if (prop->name() == X_("name")) {
|
||||
_name = prop->value();
|
||||
} else if (prop->name() == X_("orig_diskstream_id")) {
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &_orig_diskstream_id);
|
||||
_orig_diskstream_id = prop->value ();
|
||||
} else if (prop->name() == X_("frozen")) {
|
||||
_frozen = (prop->value() == X_("yes"));
|
||||
}
|
||||
|
|
@ -1404,7 +1402,7 @@ Playlist::state (bool full_state)
|
|||
|
||||
node->add_property (X_("name"), _name);
|
||||
|
||||
snprintf (buf, sizeof(buf), "%" PRIu64, _orig_diskstream_id);
|
||||
_orig_diskstream_id.print (buf);
|
||||
node->add_property (X_("orig_diskstream_id"), buf);
|
||||
node->add_property (X_("frozen"), _frozen ? "yes" : "no");
|
||||
|
||||
|
|
@ -1725,7 +1723,7 @@ Playlist::nudge_after (jack_nframes_t start, jack_nframes_t distance, bool forwa
|
|||
}
|
||||
|
||||
Region*
|
||||
Playlist::find_region (id_t id) const
|
||||
Playlist::find_region (const ID& id) const
|
||||
{
|
||||
RegionLock rlock (const_cast<Playlist*> (this));
|
||||
RegionList::const_iterator i;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@
|
|||
#include <pbd/pathscanner.h>
|
||||
#include <pbd/xml++.h>
|
||||
|
||||
#include <midi++/manager.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/session.h>
|
||||
#include <ardour/audioengine.h>
|
||||
|
|
@ -61,64 +59,59 @@ Plugin::Plugin (const Plugin& other)
|
|||
}
|
||||
|
||||
void
|
||||
Plugin::setup_midi_controls ()
|
||||
Plugin::setup_controls ()
|
||||
{
|
||||
uint32_t port_cnt;
|
||||
uint32_t port_cnt = parameter_count();
|
||||
|
||||
port_cnt = parameter_count();
|
||||
|
||||
/* set up a vector of null pointers for the MIDI controls.
|
||||
/* set up a vector of null pointers for the controls.
|
||||
we'll fill this in on an as-needed basis.
|
||||
*/
|
||||
|
||||
for (uint32_t i = 0; i < port_cnt; ++i) {
|
||||
midi_controls.push_back (0);
|
||||
controls.push_back (0);
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::~Plugin ()
|
||||
{
|
||||
for (vector<MIDIPortControl*>::iterator i = midi_controls.begin(); i != midi_controls.end(); ++i) {
|
||||
for (vector<PortControllable*>::iterator i = controls.begin(); i != controls.end(); ++i) {
|
||||
if (*i) {
|
||||
delete *i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MIDI::Controllable *
|
||||
Plugin::get_nth_midi_control (uint32_t n)
|
||||
Controllable *
|
||||
Plugin::get_nth_control (uint32_t n)
|
||||
{
|
||||
if (n >= parameter_count()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (midi_controls[n] == 0) {
|
||||
if (controls[n] == 0) {
|
||||
|
||||
Plugin::ParameterDescriptor desc;
|
||||
|
||||
get_parameter_descriptor (n, desc);
|
||||
|
||||
midi_controls[n] = new MIDIPortControl (*this, n, _session.midi_port(), desc.lower, desc.upper, desc.toggled, desc.logarithmic);
|
||||
controls[n] = new PortControllable (*this, n, desc.lower, desc.upper, desc.toggled, desc.logarithmic);
|
||||
}
|
||||
|
||||
return midi_controls[n];
|
||||
return controls[n];
|
||||
}
|
||||
|
||||
Plugin::MIDIPortControl::MIDIPortControl (Plugin& p, uint32_t port_id, MIDI::Port *port,
|
||||
float low, float up, bool t, bool loga)
|
||||
: MIDI::Controllable (port, 0), plugin (p), absolute_port (port_id)
|
||||
Plugin::PortControllable::PortControllable (Plugin& p, uint32_t port_id, float low, float up, bool t, bool loga)
|
||||
: plugin (p), absolute_port (port_id)
|
||||
{
|
||||
toggled = t;
|
||||
logarithmic = loga;
|
||||
lower = low;
|
||||
upper = up;
|
||||
range = upper - lower;
|
||||
last_written = 0; /* XXX need a good out-of-bound-value */
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void
|
||||
Plugin::MIDIPortControl::set_value (float value)
|
||||
Plugin::PortControllable::set_value (float value)
|
||||
{
|
||||
if (toggled) {
|
||||
if (value > 0.5) {
|
||||
|
|
@ -140,137 +133,26 @@ Plugin::MIDIPortControl::set_value (float value)
|
|||
}
|
||||
}
|
||||
|
||||
setting = true;
|
||||
plugin.set_parameter (absolute_port, value);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void
|
||||
Plugin::MIDIPortControl::send_feedback (float value)
|
||||
float
|
||||
Plugin::PortControllable::get_value (void) const
|
||||
{
|
||||
|
||||
if (!setting && get_midi_feedback()) {
|
||||
MIDI::byte val;
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
MIDI::EventTwoBytes data;
|
||||
|
||||
if (toggled) {
|
||||
val = (MIDI::byte) (value * 127.0f);
|
||||
} else {
|
||||
if (logarithmic) {
|
||||
value = log(value);
|
||||
}
|
||||
|
||||
val = (MIDI::byte) (((value - lower) / range) * 127.0f);
|
||||
}
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
data.controller_number = additional;
|
||||
data.value = val;
|
||||
last_written = val;
|
||||
|
||||
plugin.session().send_midi_message (get_port(), ev, ch, data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MIDI::byte*
|
||||
Plugin::MIDIPortControl::write_feedback (MIDI::byte* buf, int32_t& bufsize, float value, bool force)
|
||||
{
|
||||
if (get_midi_feedback() && bufsize > 2) {
|
||||
MIDI::channel_t ch = 0;
|
||||
MIDI::eventType ev = MIDI::none;
|
||||
MIDI::byte additional = 0;
|
||||
|
||||
if (get_control_info (ch, ev, additional)) {
|
||||
|
||||
MIDI::byte val;
|
||||
float val = plugin.get_parameter (absolute_port);
|
||||
|
||||
if (toggled) {
|
||||
|
||||
val = (MIDI::byte) (value * 127.0f);
|
||||
return val;
|
||||
|
||||
} else {
|
||||
|
||||
if (logarithmic) {
|
||||
value = log(value);
|
||||
val = log(val);
|
||||
}
|
||||
|
||||
val = (MIDI::byte) (((value - lower) / range) * 127.0f);
|
||||
return ((val - lower) / range);
|
||||
}
|
||||
|
||||
if (val != last_written || force) {
|
||||
*buf++ = MIDI::controller & ch;
|
||||
*buf++ = additional; /* controller number */
|
||||
*buf++ = val;
|
||||
last_written = val;
|
||||
bufsize -= 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Plugin::reset_midi_control (MIDI::Port* port, bool on)
|
||||
{
|
||||
MIDI::channel_t chn;
|
||||
MIDI::eventType ev;
|
||||
MIDI::byte extra;
|
||||
|
||||
for (vector<MIDIPortControl*>::iterator i = midi_controls.begin(); i != midi_controls.end(); ++i) {
|
||||
if (*i == 0)
|
||||
continue;
|
||||
(*i)->get_control_info (chn, ev, extra);
|
||||
if (!on) {
|
||||
chn = -1;
|
||||
}
|
||||
(*i)->midi_rebind (port, chn);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Plugin::send_all_midi_feedback ()
|
||||
{
|
||||
if (_session.get_midi_feedback()) {
|
||||
float val = 0.0;
|
||||
uint32_t n = 0;
|
||||
|
||||
for (vector<MIDIPortControl*>::iterator i = midi_controls.begin(); i != midi_controls.end(); ++i, ++n) {
|
||||
if (*i == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
val = (*i)->plugin.get_parameter (n);
|
||||
(*i)->send_feedback (val);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
MIDI::byte*
|
||||
Plugin::write_midi_feedback (MIDI::byte* buf, int32_t& bufsize)
|
||||
{
|
||||
if (_session.get_midi_feedback()) {
|
||||
float val = 0.0;
|
||||
uint32_t n = 0;
|
||||
|
||||
for (vector<MIDIPortControl*>::iterator i = midi_controls.begin(); i != midi_controls.end(); ++i, ++n) {
|
||||
if (*i == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
val = (*i)->plugin.get_parameter (n);
|
||||
buf = (*i)->write_feedback (buf, bufsize, val);
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
vector<string>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue