merge 12954:1363 svn+ssh://ardoursvn@subversion.ardour.org/ardour2/branches/3.0

git-svn-id: svn://localhost/ardour2/branches/3.0-SG@13364 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-10-29 16:50:05 +00:00
parent 1653b37ce9
commit 6c52612009
171 changed files with 83605 additions and 50593 deletions

30
export/Ring Tone.format Normal file
View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<ExportFormatSpecification name="Ring Tone" id="6c86b4d9-cd50-43b4-be58-526c9cbb090f" with-cue="false" with-toc="false">
<Encoding id="F_WAV" type="T_Sndfile" extension="wav" name="WAV" has-sample-format="true" channel-limit="256"/>
<SampleRate rate="8000"/>
<SRCQuality quality="SRC_SincBest"/>
<EncodingOptions>
<Option name="sample-format" value="SF_16"/>
<Option name="dithering" value="D_Shaped"/>
<Option name="tag-metadata" value="false"/>
<Option name="tag-support" value="false"/>
<Option name="broadcast-info" value="false"/>
</EncodingOptions>
<Processing>
<Normalize enabled="true" target="-0"/>
<Silence>
<Start>
<Trim enabled="false"/>
<Add enabled="false">
<Duration format="Timecode" hours="0" minutes="0" seconds="0" frames="0"/>
</Add>
</Start>
<End>
<Trim enabled="false"/>
<Add enabled="false">
<Duration format="Timecode" hours="0" minutes="0" seconds="0" frames="0"/>
</Add>
</End>
</Silence>
</Processing>
</ExportFormatSpecification>

View file

@ -197,6 +197,7 @@ static const char* translators[] = {
N_("Polish:\n\t Piotr Zaryk <pzaryk@gmail.com>\n"),
N_("Czech:\n\t Pavel Fric <pavelfric@seznam.cz>\n"),
N_("Norwegian:\n\t Eivind Ødegård\n"),
N_("Chinese:\n\t Rui-huai Zhang <zrhzrh@mail.ustc.edu.cn>\n"),
0
};

View file

@ -1,4 +1,5 @@
#!/bin/sh
. `dirname "$0"`/../build/gtk2_ardour/ardev_common_waf.sh
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export UBUNTU_MENUPROXY=""
exec $TOP/$EXECUTABLE "$@"

View file

@ -47,6 +47,12 @@ export ARDOUR_DATA_PATH=@DATADIR@/ardour3
export ARDOUR_CONFIG_PATH=@SYSCONFDIR@/ardour3
export ARDOUR_DLL_PATH=@LIBDIR@/ardour3
exec @LIBDIR@/ardour3/ardour-@VERSION@ "$@"
if [ $# -gt 0 ] ; then
case $1 in
-g|--gdb) GDB=gdb; shift ;;
esac
fi
exec $GDB @LIBDIR@/ardour3/ardour-@VERSION@ "$@"

View file

@ -73,8 +73,11 @@
#include "ardour/session_route.h"
#include "ardour/session_state_utils.h"
#include "ardour/session_utils.h"
#include "ardour/slave.h"
#include "ardour/soundgrid.h"
#include "timecode/time.h"
typedef uint64_t microseconds_t;
#include "about.h"
@ -464,6 +467,7 @@ ARDOUR_UI::post_engine ()
update_disk_space ();
update_cpu_load ();
update_sample_rate (engine->frame_rate());
update_timecode_format ();
Config->ParameterChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context());
boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
@ -895,6 +899,7 @@ ARDOUR_UI::every_second ()
update_cpu_load ();
update_buffer_load ();
update_disk_space ();
update_timecode_format ();
return TRUE;
}
@ -1104,6 +1109,31 @@ ARDOUR_UI::update_disk_space()
disk_space_label.set_markup (buf);
}
void
ARDOUR_UI::update_timecode_format ()
{
char buf[64];
if (_session) {
bool matching;
TimecodeSlave* tcslave;
if ((tcslave = dynamic_cast<TimecodeSlave*>(_session->slave())) != 0) {
matching = (tcslave->apparent_timecode_format() == _session->config.get_timecode_format());
} else {
matching = true;
}
snprintf (buf, sizeof (buf), S_("Timecode|TC: <span foreground=\"%s\">%sfps</span>"),
matching ? X_("green") : X_("red"),
Timecode::timecode_format_name (_session->config.get_timecode_format()).c_str());
} else {
snprintf (buf, sizeof (buf), "TC: n/a");
}
timecode_format_label.set_markup (buf);
}
gint
ARDOUR_UI::update_wall_clock ()
{
@ -1610,7 +1640,7 @@ ARDOUR_UI::transport_roll ()
#if 0
if (_session->config.get_external_sync()) {
switch (_session->config.get_sync_source()) {
switch (Config->get_sync_source()) {
case JACK:
break;
default:
@ -1657,7 +1687,7 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
}
if (_session->config.get_external_sync()) {
switch (_session->config.get_sync_source()) {
switch (Config->get_sync_source()) {
case JACK:
break;
default:
@ -1966,7 +1996,7 @@ JACK, reconnect and save the session."), PROGRAM_NAME);
msg.run ();
if (free_reason) {
free ((char*) reason);
free (const_cast<char*> (reason));
}
}
@ -2417,6 +2447,19 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
int ret = -1;
bool likely_new = false;
/* deal with any existing DIRTY session now, rather than later. don't
* treat a non-dirty session this way, so that it stays visible
* as we bring up the new session dialog.
*/
if (_session && _session->dirty()) {
if (unload_session (false)) {
/* unload cancelled by user */
return 0;
}
ARDOUR_COMMAND_LINE::session_name = "";
}
if (!load_template.empty()) {
should_be_new = true;
template_name = load_template;

View file

@ -502,6 +502,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
Gtk::Label disk_space_label;
void update_disk_space ();
Gtk::Label timecode_format_label;
void update_timecode_format ();
Gtk::Label cpu_load_label;
void update_cpu_load ();

View file

@ -551,6 +551,8 @@ ARDOUR_UI::build_menu_bar ()
wall_clock_label.set_use_markup ();
disk_space_label.set_name ("WallClock");
disk_space_label.set_use_markup ();
timecode_format_label.set_name ("WallClock");
timecode_format_label.set_use_markup ();
cpu_load_label.set_name ("CPULoad");
cpu_load_label.set_use_markup ();
buffer_load_label.set_name ("BufferLoad");
@ -582,6 +584,7 @@ ARDOUR_UI::build_menu_bar ()
hbox->pack_end (cpu_load_label, false, false, 4);
hbox->pack_end (buffer_load_label, false, false, 4);
hbox->pack_end (sample_rate_label, false, false, 4);
hbox->pack_end (timecode_format_label, false, false, 4);
hbox->pack_end (format_label, false, false, 4);
menu_hbox.pack_end (*ev, false, false, 6);
@ -589,12 +592,13 @@ ARDOUR_UI::build_menu_bar ()
menu_bar_base.set_name ("MainMenuBar");
menu_bar_base.add (menu_hbox);
_status_bar_visibility.add (&wall_clock_label, X_("WallClock"), _("Wall Clock"), wall_clock);
_status_bar_visibility.add (&disk_space_label, X_("Disk"), _("Disk Space"), disk_space);
_status_bar_visibility.add (&cpu_load_label, X_("DSP"), _("DSP"), true);
_status_bar_visibility.add (&buffer_load_label, X_("Buffers"), _("Buffers"), true);
_status_bar_visibility.add (&sample_rate_label, X_("JACK"), _("JACK Sampling Rate and Latency"), true);
_status_bar_visibility.add (&format_label, X_("Format"), _("File Format"), true);
_status_bar_visibility.add (&wall_clock_label, X_("WallClock"), _("Wall Clock"), wall_clock);
_status_bar_visibility.add (&disk_space_label, X_("Disk"), _("Disk Space"), disk_space);
_status_bar_visibility.add (&cpu_load_label, X_("DSP"), _("DSP"), true);
_status_bar_visibility.add (&buffer_load_label, X_("Buffers"), _("Buffers"), true);
_status_bar_visibility.add (&sample_rate_label, X_("JACK"), _("JACK Sampling Rate and Latency"), true);
_status_bar_visibility.add (&timecode_format_label, X_("TCFormat"), _("Timecode Format"), true);
_status_bar_visibility.add (&format_label, X_("Format"), _("File Format"), true);
ev->signal_button_press_event().connect (sigc::mem_fun (_status_bar_visibility, &VisibilityGroup::button_press_event));
}

View file

@ -60,7 +60,7 @@ ARDOUR_UI::toggle_external_sync()
{
if (_session) {
if (_session->config.get_video_pullup() != 0.0f) {
if (_session->config.get_sync_source() == JACK) {
if (Config->get_sync_source() == JACK) {
MessageDialog msg (
_("It is not possible to use JACK as the the sync source\n\
when the pull up/down setting is non-zero."));
@ -311,7 +311,7 @@ ARDOUR_UI::parameter_changed (std::string p)
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
} else {
sync_button.set_text (sync_source_to_string (_session->config.get_sync_source(), true));
sync_button.set_text (sync_source_to_string (Config->get_sync_source(), true));
/* XXX need to make auto-play is off as well as insensitive */
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
@ -439,7 +439,7 @@ ARDOUR_UI::synchronize_sync_source_and_video_pullup ()
act->set_sensitive (true);
} else {
/* can't sync to JACK if video pullup != 0.0 */
if (_session->config.get_sync_source() == JACK) {
if (Config->get_sync_source() == JACK) {
act->set_sensitive (false);
} else {
act->set_sensitive (true);

View file

@ -30,10 +30,11 @@
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/rgb_macros.h"
#include "ardour/types.h"
#include "ardour/session.h"
#include "ardour/tempo.h"
#include "ardour/profile.h"
#include "ardour/session.h"
#include "ardour/slave.h"
#include "ardour/tempo.h"
#include "ardour/types.h"
#include "ardour_ui.h"
#include "audio_clock.h"
@ -150,6 +151,7 @@ AudioClock::set_font ()
Glib::RefPtr<Gtk::Style> style = get_style ();
Pango::FontDescription font;
Pango::AttrFontDesc* font_attr;
uint32_t font_size;
if (!is_realized()) {
font = get_font_for_style (get_name());
@ -157,19 +159,30 @@ AudioClock::set_font ()
font = style->get_font();
}
font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
font_size = font.get_size();
font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
normal_attributes.change (*font_attr);
editing_attributes.change (*font_attr);
/* now a smaller version of the same font */
delete font_attr;
font.set_size ((int) lrint (font.get_size() * info_font_scale_factor));
font.set_size ((int) lrint (font_size * info_font_scale_factor));
font.set_weight (Pango::WEIGHT_NORMAL);
font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
info_attributes.change (*font_attr);
/* and an even smaller one */
delete font_attr;
font.set_size ((int) lrint (font_size * info_font_scale_factor * 0.75));
font.set_weight (Pango::WEIGHT_BOLD);
font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
small_info_attributes.change (*font_attr);
delete font_attr;
@ -250,6 +263,7 @@ AudioClock::set_colors ()
normal_attributes.change (*foreground_attr);
info_attributes.change (*foreground_attr);
small_info_attributes.change (*foreground_attr);
editing_attributes.change (*foreground_attr);
editing_attributes.change (*editing_attr);
@ -260,8 +274,13 @@ AudioClock::set_colors ()
}
if (_left_layout) {
_left_layout->set_attributes (info_attributes);
_right_layout->set_attributes (info_attributes);
if (_mode == Timecode) {
_left_layout->set_attributes (small_info_attributes);
_right_layout->set_attributes (small_info_attributes);
} else {
_left_layout->set_attributes (info_attributes);
_right_layout->set_attributes (info_attributes);
}
}
queue_draw ();
@ -919,7 +938,12 @@ AudioClock::set (framepos_t when, bool force, framecnt_t offset)
}
if (when == last_when && !force) {
return;
if (_mode != Timecode) {
/* timecode may need to force display of TC source
* time, so don't return early.
*/
return;
}
}
if (!editing) {
@ -1047,7 +1071,6 @@ AudioClock::set_minsec (framepos_t when, bool /*force*/)
void
AudioClock::set_timecode (framepos_t when, bool /*force*/)
{
char buf[32];
Timecode::Time TC;
bool negative = false;
@ -1071,42 +1094,62 @@ AudioClock::set_timecode (framepos_t when, bool /*force*/)
} else {
_session->timecode_time (when, TC);
}
if (TC.negative || negative) {
snprintf (buf, sizeof (buf), "-%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, TC.hours, TC.minutes, TC.seconds, TC.frames);
} else {
snprintf (buf, sizeof (buf), " %02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, TC.hours, TC.minutes, TC.seconds, TC.frames);
}
_layout->set_text (buf);
TC.negative = TC.negative || negative;
if (_left_layout) {
_layout->set_text (Timecode::timecode_format_time(TC));
if (_left_layout && _right_layout) {
SyncSource sync_src = Config->get_sync_source();
if (_session->config.get_external_sync()) {
switch (_session->config.get_sync_source()) {
Slave* slave = _session->slave();
switch (sync_src) {
case JACK:
_left_layout->set_text ("JACK");
_left_layout->set_text (string_compose ("%1",
sync_source_to_string(sync_src, true)));
_right_layout->set_text ("");
break;
case MTC:
_left_layout->set_text ("MTC");
if (slave) {
_left_layout->set_text (string_compose ("%1",
dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
_right_layout->set_text (slave->approximate_current_delta());
} else {
_left_layout->set_text (string_compose ("--pending--",
sync_source_to_string(sync_src, true)));
_right_layout->set_text ("");
}
break;
case MIDIClock:
_left_layout->set_text ("M-Clock");
if (slave) {
_left_layout->set_text (string_compose ("%1",
sync_source_to_string(sync_src, true)));
_right_layout->set_text (slave->approximate_current_delta());
} else {
_left_layout->set_text (string_compose ("%1 --pending--",
sync_source_to_string(sync_src, true)));
_right_layout->set_text ("");
}
break;
case LTC:
if (slave) {
_left_layout->set_text (string_compose ("%1",
dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
_right_layout->set_text (slave->approximate_current_delta());
} else {
_left_layout->set_text (string_compose ("%1 --pending--",
sync_source_to_string(sync_src, true)));
_right_layout->set_text ("");
}
break;
}
} else {
_left_layout->set_text ("INT");
_left_layout->set_text (string_compose (_("INT/%1"),
sync_source_to_string(sync_src, true)));
_right_layout->set_text ("");
}
double timecode_frames = _session->timecode_frames_per_second();
if (fmod(timecode_frames, 1.0) == 0.0) {
sprintf (buf, "FPS %u %s", int (timecode_frames), (_session->timecode_drop_frames() ? "D" : ""));
} else {
sprintf (buf, "%.2f %s", timecode_frames, (_session->timecode_drop_frames() ? "D" : ""));
}
_right_layout->set_text (buf);
}
}
@ -1914,7 +1957,7 @@ AudioClock::frame_duration_from_bbt_string (framepos_t pos, const string& str) c
if (sscanf (str.c_str(), BBT_SCANF_FORMAT, &bbt.bars, &bbt.beats, &bbt.ticks) != 3) {
return 0;
}
return _session->tempo_map().bbt_duration_at(pos,bbt,1);
}
@ -2031,6 +2074,16 @@ AudioClock::set_mode (Mode m)
break;
}
if (_left_layout) {
if (_mode == Timecode) {
_left_layout->set_attributes (small_info_attributes);
_right_layout->set_attributes (small_info_attributes);
} else {
_left_layout->set_attributes (info_attributes);
_right_layout->set_attributes (info_attributes);
}
}
set (last_when, true);
if (!is_transient) {

View file

@ -114,6 +114,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
Pango::AttrList normal_attributes;
Pango::AttrList editing_attributes;
Pango::AttrList info_attributes;
Pango::AttrList small_info_attributes;
int first_height;
int first_width;

View file

@ -20,6 +20,7 @@
#include <cassert>
#include <algorithm>
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include <gtkmm.h>
@ -1520,7 +1521,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
}
Points* points = get_canvas_points ("xfade edit redraw", npoints);
boost::scoped_ptr<float> vec (new float[npoints]);
boost::scoped_array<float> vec (new float[npoints]);
double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1.0;
ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);

View file

@ -105,7 +105,7 @@ AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
create_automation_child (GainAutomation, false);
}
if (_route->panner()) {
if (_route->panner_shell()) {
_route->panner_shell()->Changed.connect (*this, invalidator (*this),
boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false), gui_context());
}

View file

@ -19,27 +19,27 @@ class CanvasFlag : public Group
{
public:
CanvasFlag (MidiRegionView& region,
Group& parent,
double height,
guint outline_color_rgba = 0xc0c0c0ff,
guint fill_color_rgba = 0x07070707,
double x = 0.0,
double y = 0.0);
Group& parent,
double height,
guint outline_color_rgba = 0xc0c0c0ff,
guint fill_color_rgba = 0x07070707,
double x = 0.0,
double y = 0.0);
virtual ~CanvasFlag();
virtual void set_text(const std::string& a_text);
virtual void set_height (double);
int width () const { return name_pixbuf_width + 10.0; }
int width () const { return name_pixbuf_width + 10.0; }
protected:
ArdourCanvas::Pixbuf* _name_pixbuf;
double _height;
guint _outline_color_rgba;
guint _fill_color_rgba;
MidiRegionView& _region;
int name_pixbuf_width;
int name_pixbuf_width;
private:
void delete_allocated_objects();

View file

@ -21,6 +21,7 @@
#include "ardour_ui.h"
#include "midi_region_view.h"
#include "canvas-sysex.h"
using namespace Gnome::Canvas;
@ -32,7 +33,8 @@ CanvasSysEx::CanvasSysEx(
string& text,
double height,
double x,
double y)
double y,
const ARDOUR::MidiModel::SysExPtr sysex)
: CanvasFlag(
region,
parent,
@ -40,8 +42,10 @@ CanvasSysEx::CanvasSysEx(
ARDOUR_UI::config()->canvasvar_MidiSysExOutline.get(),
ARDOUR_UI::config()->canvasvar_MidiSysExFill.get(),
x,
y)
y),
_sysex(sysex)
{
_text = text;
set_text(text);
}
@ -67,6 +71,28 @@ CanvasSysEx::on_event(GdkEvent* ev)
}
break;
case GDK_KEY_PRESS:
switch (ev->key.keyval) {
case GDK_Delete:
case GDK_BackSpace:
_region.delete_sysex (this);
break;
default:
break;
}
break;
case GDK_ENTER_NOTIFY:
_region.sysex_entered (this);
return true;
break;
case GDK_LEAVE_NOTIFY:
_region.sysex_left (this);
return true;
break;
default:
break;
}

View file

@ -23,6 +23,7 @@
#include <string>
#include "canvas-flag.h"
#include "ardour/midi_model.h"
class MidiRegionView;
@ -38,11 +39,20 @@ public:
std::string& text,
double height,
double x,
double y);
double y,
ARDOUR::MidiModel::SysExPtr sysex);
virtual ~CanvasSysEx();
const ARDOUR::MidiModel::SysExPtr sysex() const { return _sysex; }
const string text() const { return _text; }
virtual bool on_event(GdkEvent* ev);
private:
const ARDOUR::MidiModel::SysExPtr _sysex;
string _text;
};
} // namespace Canvas

View file

@ -63,7 +63,7 @@ public:
void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey& key);
private:
ARDOUR::InstrumentInfo& _info;
ARDOUR::InstrumentInfo& _info;
ARDOUR::MidiModel::PatchChangePtr _patch;
Gtk::Menu _popup;
bool _popup_initialized;

View file

@ -1178,6 +1178,8 @@ Editor::update_title ()
WindowTitle title(session_name);
title += Glib::get_application_name();
set_title (title.get_string());
} else {
/* ::session_going_away() will have taken care of it */
}
}
@ -3112,8 +3114,8 @@ Editor::convert_drop_to_paths (
const char* q;
p = (const char *) malloc (txt.length() + 1);
txt.copy ((char *) p, txt.length(), 0);
((char*)p)[txt.length()] = '\0';
txt.copy (const_cast<char *> (p), txt.length(), 0);
const_cast<char*>(p)[txt.length()] = '\0';
while (p)
{
@ -3194,7 +3196,7 @@ Editor::new_tempo_section ()
void
Editor::map_transport_state ()
{
ENSURE_GUI_THREAD (*this, &Editor::map_transport_state)
ENSURE_GUI_THREAD (*this, &Editor::map_transport_state);
if (_session && _session->transport_stopped()) {
have_pending_keyboard_selection = false;
@ -4736,9 +4738,11 @@ Editor::located ()
{
ENSURE_GUI_THREAD (*this, &Editor::located);
playhead_cursor->set_position (_session->audible_frame ());
if (_follow_playhead && !_pending_initial_locate) {
reset_x_origin_to_follow_playhead ();
if (_session) {
playhead_cursor->set_position (_session->audible_frame ());
if (_follow_playhead && !_pending_initial_locate) {
reset_x_origin_to_follow_playhead ();
}
}
_pending_locate_request = false;
@ -5300,6 +5304,8 @@ Editor::session_going_away ()
hide_measures ();
clear_marker_display ();
stop_step_editing ();
current_bbt_points_begin = current_bbt_points_end;
/* get rid of any existing editor mixer strip */

View file

@ -2106,7 +2106,7 @@ Editor::transition_to_rolling (bool fwd)
}
if (_session->config.get_external_sync()) {
switch (_session->config.get_sync_source()) {
switch (Config->get_sync_source()) {
case JACK:
break;
default:

View file

@ -45,6 +45,7 @@
#include "gui_thread.h"
#include "actions.h"
#include "utils.h"
#include "route_sorter.h"
#include "editor_group_tabs.h"
#include "editor_routes.h"
@ -966,21 +967,30 @@ EditorRoutes::sync_treeview_from_order_keys (RouteSortOrderKey src)
return;
}
neworder.assign (rows.size(), 0);
OrderKeySortedRoutes sorted_routes;
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
boost::shared_ptr<Route> route = (*ri)[_columns.route];
uint32_t new_order = route->order_key (EditorSort);
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("EDITOR change order for %1 from %2 to %3\n",
route->name(), old_order, new_order));
neworder[new_order] = old_order;
sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key (EditorSort)));
}
if (old_order != new_order) {
SortByNewDisplayOrder cmp;
sort (sorted_routes.begin(), sorted_routes.end(), cmp);
neworder.assign (sorted_routes.size(), 0);
uint32_t n = 0;
for (OrderKeySortedRoutes::iterator sr = sorted_routes.begin(); sr != sorted_routes.end(); ++sr, ++n) {
neworder[n] = sr->old_display_order;
if (sr->old_display_order != n) {
changed = true;
}
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("EDITOR change order for %1 from %2 to %3\n",
sr->route->name(), sr->old_display_order, n));
}
if (changed) {

View file

@ -818,6 +818,8 @@ Editor::update_fixed_rulers ()
return;
}
compute_fixed_ruler_scale ();
ruler_metrics[ruler_metric_timecode].units_per_pixel = frames_per_unit;
ruler_metrics[ruler_metric_samples].units_per_pixel = frames_per_unit;
ruler_metrics[ruler_metric_minsec].units_per_pixel = frames_per_unit;
@ -1083,6 +1085,7 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble
}
(*marks)[n].label = g_strdup (buf);
(*marks)[n].position = pos;
Timecode::increment_minutes( timecode, _session->config.get_subframes_per_frame() );
}

View file

@ -310,17 +310,15 @@ bool
EditorSummary::on_key_press_event (GdkEventKey* key)
{
gint x, y;
switch (key->keyval) {
case GDK_p:
if (_session) {
get_pointer (x, y);
_session->request_locate ((framepos_t) x / _x_scale, _session->transport_rolling());
return true;
GtkAccelKey set_playhead_accel;
if (gtk_accel_map_lookup_entry ("<Actions>/Editor/set-playhead", &set_playhead_accel)) {
if (key->keyval == set_playhead_accel.accel_key && (int) key->state == set_playhead_accel.accel_mods) {
if (_session) {
get_pointer (x, y);
_session->request_locate ((framepos_t) x / _x_scale, _session->transport_rolling());
return true;
}
}
break;
default:
break;
}
return false;
@ -329,11 +327,12 @@ EditorSummary::on_key_press_event (GdkEventKey* key)
bool
EditorSummary::on_key_release_event (GdkEventKey* key)
{
switch (key->keyval) {
case GDK_p:
return true;
default:
break;
GtkAccelKey set_playhead_accel;
if (gtk_accel_map_lookup_entry ("<Actions>/Editor/set-playhead", &set_playhead_accel)) {
if (key->keyval == set_playhead_accel.accel_key && (int) key->state == set_playhead_accel.accel_mods) {
return true;
}
}
return false;
}

View file

@ -28,8 +28,6 @@
#include "pbd/xml++.h"
#include "pbd/id.h"
#include "i18n.h"
class GUIObjectState
{
public:

View file

@ -54,10 +54,15 @@ LV2PluginUI::write_from_ui(void* controller,
boost::shared_ptr<AutomationControl> ac = me->_controllables[port_index];
if (ac) {
ac->set_value(*(float*)buffer);
ac->set_value(*(const float*)buffer);
}
} else if (format == me->_lv2->atom_eventTransfer()) {
me->_lv2->write_from_ui(port_index, format, buffer_size, (uint8_t*)buffer);
const int cnt = me->_pi->get_count();
for (int i=0; i < cnt; i++ ) {
boost::shared_ptr<LV2Plugin> lv2i = boost::dynamic_pointer_cast<LV2Plugin> (me->_pi->plugin(i));
lv2i->write_from_ui(port_index, format, buffer_size, (const uint8_t*)buffer);
}
}
}
@ -176,6 +181,7 @@ LV2PluginUI::output_update()
LV2PluginUI::LV2PluginUI(boost::shared_ptr<PluginInsert> pi,
boost::shared_ptr<LV2Plugin> lv2p)
: PlugUIBase(pi)
, _pi(pi)
, _lv2(lv2p)
, _gui_widget(NULL)
, _ardour_buttons_box(NULL)
@ -188,14 +194,15 @@ LV2PluginUI::LV2PluginUI(boost::shared_ptr<PluginInsert> pi,
void
LV2PluginUI::lv2ui_instantiate(const std::string& title)
{
LV2_Feature** features;
LV2_Feature** features_src;
LV2_Feature** features_dst;
size_t features_count;
bool is_external_ui;
is_external_ui = _lv2->is_external_ui();
bool is_external_ui = _lv2->is_external_ui();
LV2_Feature** features_src = const_cast<LV2_Feature**>(_lv2->features());
LV2_Feature** features = const_cast<LV2_Feature**>(_lv2->features());
size_t features_count = 0;
while (*features++) {
features_count++;
}
Gtk::Alignment* container = NULL;
if (is_external_ui) {
_external_ui_host.ui_closed = LV2PluginUI::on_external_ui_closed;
_external_ui_host.plugin_human_id = strdup(title.c_str());
@ -203,20 +210,43 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
_external_ui_feature.URI = LV2_EXTERNAL_UI_URI;
_external_ui_feature.data = &_external_ui_host;
features_src = features = (LV2_Feature**)_lv2->features();
features_count = 2;
while (*features++) {
features_count++;
}
features_dst = features = (LV2_Feature**)malloc(
sizeof(LV2_Feature*) * features_count);
features_dst[--features_count] = NULL;
features_dst[--features_count] = &_external_ui_feature;
while (features_count--) {
*features++ = *features_src++;
++features_count;
features = (LV2_Feature**)malloc(
sizeof(LV2_Feature*) * (features_count + 1));
for (size_t i = 0; i < features_count - 1; ++i) {
features[i] = features_src[i];
}
features[features_count - 1] = &_external_ui_feature;
features[features_count] = NULL;
} else {
features_dst = (LV2_Feature**)_lv2->features();
_ardour_buttons_box = manage (new Gtk::HBox);
_ardour_buttons_box->set_spacing (6);
_ardour_buttons_box->set_border_width (6);
_ardour_buttons_box->pack_end (focus_button, false, false);
_ardour_buttons_box->pack_end (bypass_button, false, false, 10);
_ardour_buttons_box->pack_end (delete_button, false, false);
_ardour_buttons_box->pack_end (save_button, false, false);
_ardour_buttons_box->pack_end (add_button, false, false);
_ardour_buttons_box->pack_end (_preset_combo, false, false);
_ardour_buttons_box->pack_end (_preset_modified, false, false);
_ardour_buttons_box->show_all();
pack_start(*_ardour_buttons_box, false, false);
_gui_widget = Gtk::manage((container = new Gtk::Alignment()));
pack_start(*_gui_widget, true, true);
_gui_widget->show();
_parent_feature.URI = LV2_UI__parent;
_parent_feature.data = _gui_widget->gobj();
++features_count;
features = (LV2_Feature**)malloc(
sizeof(LV2_Feature*) * (features_count + 1));
for (size_t i = 0; i < features_count - 1; ++i) {
features[i] = features_src[i];
}
features[features_count - 1] = &_parent_feature;
features[features_count] = NULL;
}
if (!ui_host) {
@ -229,7 +259,7 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
? NS_UI "external"
: NS_UI "GtkUI";
LilvUI* ui = (LilvUI*)_lv2->c_ui();
const LilvUI* ui = (const LilvUI*)_lv2->c_ui();
_inst = suil_instance_new(
ui_host,
this,
@ -239,11 +269,9 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
lilv_node_as_uri((const LilvNode*)_lv2->c_ui_type()),
lilv_uri_to_path(lilv_node_as_uri(lilv_ui_get_bundle_uri(ui))),
lilv_uri_to_path(lilv_node_as_uri(lilv_ui_get_binary_uri(ui))),
features_dst);
features);
if (is_external_ui) {
free(features_dst);
}
free(features);
#define GET_WIDGET(inst) suil_instance_get_widget((SuilInstance*)inst);
@ -259,19 +287,6 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
_external_ui_ptr = NULL;
if (_inst) {
if (!is_external_ui) {
_ardour_buttons_box = manage (new Gtk::HBox);
_ardour_buttons_box->set_spacing (6);
_ardour_buttons_box->set_border_width (6);
_ardour_buttons_box->pack_end (focus_button, false, false);
_ardour_buttons_box->pack_end (bypass_button, false, false, 10);
_ardour_buttons_box->pack_end (delete_button, false, false);
_ardour_buttons_box->pack_end (save_button, false, false);
_ardour_buttons_box->pack_end (add_button, false, false);
_ardour_buttons_box->pack_end (_preset_combo, false, false);
_ardour_buttons_box->pack_end (_preset_modified, false, false);
_ardour_buttons_box->show_all();
pack_start(*_ardour_buttons_box, false, false);
GtkWidget* c_widget = (GtkWidget*)GET_WIDGET(_inst);
if (!c_widget) {
error << _("failed to get LV2 UI widget") << endmsg;
@ -279,9 +294,11 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
_inst = NULL;
return;
}
_gui_widget = Gtk::manage(Glib::wrap(c_widget));
_gui_widget->show_all();
pack_start(*_gui_widget, true, true);
if (!container->get_child()) {
// Suil didn't add the UI to the container for us, so do it now
container->add(*Gtk::manage(Glib::wrap(c_widget)));
}
container->show_all();
} else {
_external_ui_ptr = (struct lv2_external_ui*)GET_WIDGET(_inst);
}

View file

@ -36,6 +36,7 @@
#include "plugin_ui.h"
#ifdef LV2_SUPPORT
#include "ardour/plugin_insert.h"
#include "lv2_external_ui.h"
@ -66,6 +67,7 @@ class LV2PluginUI : public PlugUIBase, public Gtk::VBox
typedef boost::shared_ptr<ARDOUR::AutomationControl> ControllableRef;
boost::shared_ptr<ARDOUR::PluginInsert> _pi;
boost::shared_ptr<ARDOUR::LV2Plugin> _lv2;
std::vector<int> _output_ports;
sigc::connection _screen_update_connection;
@ -77,6 +79,7 @@ class LV2PluginUI : public PlugUIBase, public Gtk::VBox
struct lv2_external_ui_host _external_ui_host;
LV2_Feature _external_ui_feature;
struct lv2_external_ui* _external_ui_ptr;
LV2_Feature _parent_feature;
Gtk::Window* _win_ptr;
void* _inst;

View file

@ -44,10 +44,11 @@ public:
protected:
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr) = 0;
Gtk::Label _button_labels[4][4];
Gtk::Label _button_labels[4][4];
Gtkmm2ext::StatefulToggleButton _buttons[4][4];
int _recursion_counter;
bool was_clicked (GdkEventButton*);
int _recursion_counter;
bool was_clicked (GdkEventButton*);
};
class SingleMidiChannelSelector : public MidiChannelSelector
@ -81,6 +82,7 @@ public:
sigc::signal<void, ARDOUR::ChannelMode, uint16_t> mode_changed;
void set_channel_mode(ARDOUR::ChannelMode mode, uint16_t mask);
ARDOUR::ChannelMode get_channel_mode () const { return _channel_mode; }
/**
* @return each bit in the returned word represents a midi channel, eg.

View file

@ -19,12 +19,16 @@
#include <gtkmm/stock.h>
#include "pbd/compose.h"
#include "ardour/directory_names.h"
#include "ardour/midi_region.h"
#include "ardour/session.h"
#include "midi_export_dialog.h"
#include "i18n.h"
using namespace ARDOUR;
MidiExportDialog::MidiExportDialog (PublicEditor&, boost::shared_ptr<MidiRegion> region)

View file

@ -48,6 +48,7 @@
#include "canvas-hit.h"
#include "canvas-note.h"
#include "canvas_patch_change.h"
#include "canvas-sysex.h"
#include "debug.h"
#include "editor.h"
#include "editor_drag.h"
@ -115,6 +116,13 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
_note_group->raise_to_top();
PublicEditor::DropDownKeys.connect (sigc::mem_fun (*this, &MidiRegionView::drop_down_keys));
MidiTimeAxisView *time_axis = dynamic_cast<MidiTimeAxisView *>(&tv);
if (time_axis) {
_last_channel_mode = time_axis->channel_selector().get_channel_mode();
_last_channel_selection = time_axis->channel_selector().get_selected_channels();
}
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&MidiRegionView::parameter_changed, this, _1), gui_context());
connect_to_diskstream ();
@ -152,6 +160,12 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
_note_group->raise_to_top();
PublicEditor::DropDownKeys.connect (sigc::mem_fun (*this, &MidiRegionView::drop_down_keys));
MidiTimeAxisView *time_axis = dynamic_cast<MidiTimeAxisView *>(&tv);
if (time_axis) {
_last_channel_mode = time_axis->channel_selector().get_channel_mode();
_last_channel_selection = time_axis->channel_selector().get_selected_channels();
}
connect_to_diskstream ();
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
@ -1291,12 +1305,12 @@ MidiRegionView::display_sysexes()
}
string text = str.str();
const double x = trackview.editor().frame_to_pixel(source_beats_to_absolute_frames(time));
const double x = trackview.editor().frame_to_pixel(source_beats_to_region_frames(time));
double height = midi_stream_view()->contents_height();
boost::shared_ptr<CanvasSysEx> sysex = boost::shared_ptr<CanvasSysEx>(
new CanvasSysEx(*this, *_note_group, text, height, x, 1.0));
new CanvasSysEx(*this, *_note_group, text, height, x, 1.0, (*i)));
// Show unless message is beyond the region bounds
if (time - _region->start() >= _region->length() || time < _region->start()) {
@ -3171,6 +3185,24 @@ MidiRegionView::patch_left (ArdourCanvas::CanvasPatchChange *)
*/
}
void
MidiRegionView::sysex_entered (ArdourCanvas::CanvasSysEx* p)
{
ostringstream s;
s << p->text();
show_verbose_cursor (s.str(), 10, 20);
p->grab_focus();
}
void
MidiRegionView::sysex_left (ArdourCanvas::CanvasSysEx *)
{
trackview.editor().verbose_cursor()->hide ();
/* focus will transfer back via the enter-notify event sent to this
* midi region view.
*/
}
void
MidiRegionView::note_mouse_position (float x_fraction, float /*y_fraction*/, bool can_set_cursor)
{
@ -3228,6 +3260,7 @@ MidiRegionView::midi_channel_mode_changed(ChannelMode mode, uint16_t mask)
}
_last_channel_selection = mask;
_last_channel_mode = mode;
_patch_changes.clear ();
display_patch_changes ();
@ -3682,6 +3715,14 @@ MidiRegionView::data_recorded (boost::weak_ptr<MidiSource> w)
Evoral::MIDIEvent<MidiBuffer::TimeType> const ev (*i, false);
assert (ev.buffer ());
if(ev.is_channel_event()) {
if (_last_channel_mode == FilterChannels) {
if(((uint16_t(1) << ev.channel()) & _last_channel_selection) == 0) {
continue;
}
}
}
/* ev.time() is in session frames, so (ev.time() - converter.origin_b()) is
frames from the start of the source, and so time_beats is in terms of the
source.
@ -3752,6 +3793,16 @@ MidiRegionView::edit_patch_change (ArdourCanvas::CanvasPatchChange* pc)
change_patch_change (pc->patch(), d.patch ());
}
void
MidiRegionView::delete_sysex (CanvasSysEx* sysex)
{
MidiModel::SysExDiffCommand* c = _model->new_sysex_diff_command (_("delete sysex"));
c->remove (sysex->sysex());
_model->apply_command (*trackview.session(), c);
_sys_exes.clear ();
display_sysexes();
}
void
MidiRegionView::show_verbose_cursor (boost::shared_ptr<NoteType> n) const

View file

@ -145,6 +145,8 @@ public:
void delete_patch_change (ArdourCanvas::CanvasPatchChange *);
void edit_patch_change (ArdourCanvas::CanvasPatchChange *);
void delete_sysex (ArdourCanvas::CanvasSysEx*);
/** Alter a given patch to be its predecessor in the MIDNAM file.
*/
void previous_patch (ArdourCanvas::CanvasPatchChange &);
@ -183,6 +185,8 @@ public:
void note_left(ArdourCanvas::CanvasNoteEvent* ev);
void patch_entered (ArdourCanvas::CanvasPatchChange *);
void patch_left (ArdourCanvas::CanvasPatchChange *);
void sysex_entered (ArdourCanvas::CanvasSysEx* p);
void sysex_left (ArdourCanvas::CanvasSysEx* p);
void note_mouse_position (float xfraction, float yfraction, bool can_set_cursor=true);
void unique_select(ArdourCanvas::CanvasNoteEvent* ev);
void note_selected(ArdourCanvas::CanvasNoteEvent* ev, bool add, bool extend=false);
@ -375,7 +379,9 @@ private:
void show_verbose_cursor (std::string const &, double, double) const;
void show_verbose_cursor (boost::shared_ptr<NoteType>) const;
ARDOUR::ChannelMode _last_channel_mode;
uint16_t _last_channel_selection;
uint8_t _current_range_min;
uint8_t _current_range_max;

View file

@ -128,6 +128,9 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
if (is_track ()) {
_piano_roll_header = new PianoRollHeader(*midi_view());
_range_scroomer = new MidiScroomer(midi_view()->note_range_adjustment);
_range_scroomer->DoubleClicked.connect (sigc::bind (
sigc::mem_fun(*this, &MidiTimeAxisView::set_note_range),
MidiStreamView::ContentsRange, false));
}
/* This next call will result in our height being set up, so it must come after
@ -201,35 +204,44 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
}
}
HBox* midi_controls_hbox = manage(new HBox());
MIDI::Name::MidiPatchManager& patch_manager = MIDI::Name::MidiPatchManager::instance();
MIDI::Name::MasterDeviceNames::Models::const_iterator m = patch_manager.all_models().begin();
for (; m != patch_manager.all_models().end(); ++m) {
_model_selector.append_text(m->c_str());
_midnam_model_selector.append_text(m->c_str());
}
_midnam_model_selector.set_active_text (gui_property (X_("midnam-model-name")));
model_changed();
_midnam_custom_device_mode_selector.set_active_text (gui_property (X_("midnam-custom-device-mode")));
_model_selector.signal_changed().connect(sigc::mem_fun(*this, &MidiTimeAxisView::model_changed));
_custom_device_mode_selector.signal_changed().connect(
_midnam_model_selector.signal_changed().connect(sigc::mem_fun(*this, &MidiTimeAxisView::model_changed));
_midnam_custom_device_mode_selector.signal_changed().connect(
sigc::mem_fun(*this, &MidiTimeAxisView::custom_device_mode_changed));
_model_selector.set_active_text (gui_property (X_("midnam-model-name")));
_custom_device_mode_selector.set_active_text (gui_property (X_("midnam-custom-device-mode")));
ARDOUR_UI::instance()->set_tip (_midnam_model_selector, _("External MIDI Device"));
ARDOUR_UI::instance()->set_tip (_midnam_custom_device_mode_selector, _("External Device Mode"));
ARDOUR_UI::instance()->set_tip (_model_selector, _("External MIDI Device"));
ARDOUR_UI::instance()->set_tip (_custom_device_mode_selector, _("External Device Mode"));
midi_controls_hbox->pack_start(_channel_selector, true, false);
_midi_controls_box.set_homogeneous(false);
_midi_controls_box.set_border_width (10);
if (!patch_manager.all_models().empty()) {
_midi_controls_box.set_border_width (5);
_midi_controls_box.pack_start(_model_selector, true, false);
_midi_controls_box.pack_start(_custom_device_mode_selector, true, false);
}
_channel_selector.set_border_width(2);
_midi_controls_box.resize(3, 2);
_midi_controls_box.attach(_channel_selector, 0, 2, 0, 1);
_midi_controls_box.pack_start(*midi_controls_hbox, true, true);
_midi_controls_box.attach(*manage(new HSeparator()), 0, 2, 1, 2);
_midnam_model_selector.set_size_request(22, 30);
_midnam_model_selector.set_border_width(2);
_midi_controls_box.attach(_midnam_model_selector, 0, 1, 2, 3);
_midnam_custom_device_mode_selector.set_size_request(10, 30);
_midnam_custom_device_mode_selector.set_border_width(2);
_midi_controls_box.attach(_midnam_custom_device_mode_selector, 1, 2, 2, 3);
} else {
_midi_controls_box.attach(_channel_selector, 0, 1, 0, 1);
}
controls_vbox.pack_start(_midi_controls_box, false, false);
@ -321,25 +333,30 @@ MidiTimeAxisView::check_step_edit ()
void
MidiTimeAxisView::model_changed()
{
std::list<std::string> device_modes = MIDI::Name::MidiPatchManager::instance()
.custom_device_mode_names_by_model(_model_selector.get_active_text());
string model = _midnam_model_selector.get_active_text();
set_gui_property (X_("midnam-model-name"), model);
_custom_device_mode_selector.clear_items();
std::list<std::string> device_modes = MIDI::Name::MidiPatchManager::instance()
.custom_device_mode_names_by_model(model);
_midnam_custom_device_mode_selector.clear_items();
for (std::list<std::string>::const_iterator i = device_modes.begin();
i != device_modes.end(); ++i) {
_custom_device_mode_selector.append_text(*i);
_midnam_custom_device_mode_selector.append_text(*i);
}
_custom_device_mode_selector.set_active(0);
_midnam_custom_device_mode_selector.set_active(0);
_route->instrument_info().set_external_instrument (_model_selector.get_active_text(), _custom_device_mode_selector.get_active_text());
_route->instrument_info().set_external_instrument (_midnam_model_selector.get_active_text(), _midnam_custom_device_mode_selector.get_active_text());
}
void
MidiTimeAxisView::custom_device_mode_changed()
{
_route->instrument_info().set_external_instrument (_model_selector.get_active_text(), _custom_device_mode_selector.get_active_text());
string mode = _midnam_custom_device_mode_selector.get_active_text();
set_gui_property (X_("midnam-custom-device-mode"), mode);
_route->instrument_info().set_external_instrument (_midnam_model_selector.get_active_text(), mode);
}
MidiStreamView*

View file

@ -130,10 +130,10 @@ class MidiTimeAxisView : public RouteTimeAxisView
Gtk::RadioMenuItem* _meter_color_mode_item;
Gtk::RadioMenuItem* _channel_color_mode_item;
Gtk::RadioMenuItem* _track_color_mode_item;
Gtk::VBox _midi_controls_box;
Gtk::Table _midi_controls_box;
MidiMultipleChannelSelector _channel_selector;
Gtk::ComboBoxText _model_selector;
Gtk::ComboBoxText _custom_device_mode_selector;
Gtk::ComboBoxText _midnam_model_selector;
Gtk::ComboBoxText _midnam_custom_device_mode_selector;
Gtk::CheckMenuItem* _step_edit_item;
Gtk::Menu* default_channel_menu;

View file

@ -63,7 +63,7 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT
msg.set_justify (JUSTIFY_CENTER);
msg.set_markup (string_compose (_("%1 cannot find the %2 file\n\n<i>%3</i>\n\nin any of these folders:\n\n\
<tt>%4</tt>\n\n"), PROGRAM_NAME, typestr, path, dirstr));
<tt>%4</tt>\n\n"), PROGRAM_NAME, typestr, Glib::Markup::escape_text(path), Glib::Markup::escape_text (dirstr)));
HBox* hbox = manage (new HBox);
hbox->pack_start (msg, false, true);

View file

@ -874,7 +874,7 @@ MixerStrip::input_press (GdkEventButton *ev)
}
void
MixerStrip::bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
MixerStrip::bundle_input_chosen (boost::shared_ptr<ARDOUR::Bundle> c)
{
if (ignore_toggle) {
return;
@ -883,14 +883,14 @@ MixerStrip::bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
ARDOUR::BundleList current = _route->input()->bundles_connected ();
if (std::find (current.begin(), current.end(), c) == current.end()) {
_route->input()->connect_ports_to_bundle (c, this);
_route->input()->connect_ports_to_bundle (c, true, this);
} else {
_route->input()->disconnect_ports_from_bundle (c, this);
}
}
void
MixerStrip::bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
MixerStrip::bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle> c)
{
if (ignore_toggle) {
return;
@ -899,7 +899,7 @@ MixerStrip::bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
ARDOUR::BundleList current = _route->output()->bundles_connected ();
if (std::find (current.begin(), current.end(), c) == current.end()) {
_route->output()->connect_ports_to_bundle (c, this);
_route->output()->connect_ports_to_bundle (c, true, this);
} else {
_route->output()->disconnect_ports_from_bundle (c, this);
}
@ -930,13 +930,7 @@ MixerStrip::maybe_add_bundle_to_input_menu (boost::shared_ptr<Bundle> b, ARDOUR:
std::string n = b->name ();
replace_all (n, "_", " ");
citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_toggled), b)));
if (std::find (current.begin(), current.end(), b) != current.end()) {
ignore_toggle = true;
dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
ignore_toggle = false;
}
citems.push_back (MenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_chosen), b)));
}
void
@ -964,13 +958,7 @@ MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR
std::string n = b->name ();
replace_all (n, "_", " ");
citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_toggled), b)));
if (std::find (current.begin(), current.end(), b) != current.end()) {
ignore_toggle = true;
dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
ignore_toggle = false;
}
citems.push_back (MenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_chosen), b)));
}
void

View file

@ -219,8 +219,8 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &);
void bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle>);
void bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle>);
void bundle_input_chosen (boost::shared_ptr<ARDOUR::Bundle>);
void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
void edit_input_configuration ();
void edit_output_configuration ();

View file

@ -51,6 +51,7 @@
#include "ardour_ui.h"
#include "prompter.h"
#include "utils.h"
#include "route_sorter.h"
#include "actions.h"
#include "gui_thread.h"
#include "mixer_group_tabs.h"
@ -543,20 +544,30 @@ Mixer_UI::sync_treeview_from_order_keys (RouteSortOrderKey src)
return;
}
neworder.assign (rows.size(), 0);
OrderKeySortedRoutes sorted_routes;
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
uint32_t new_order = route->order_key (MixerSort);
sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key (MixerSort)));
}
neworder[new_order] = old_order;
SortByNewDisplayOrder cmp;
if (old_order != new_order) {
sort (sorted_routes.begin(), sorted_routes.end(), cmp);
neworder.assign (sorted_routes.size(), 0);
uint32_t n = 0;
for (OrderKeySortedRoutes::iterator sr = sorted_routes.begin(); sr != sorted_routes.end(); ++sr, ++n) {
neworder[n] = sr->old_display_order;
if (sr->old_display_order != n) {
changed = true;
}
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("MIXER change order for %1 from %2 to %3\n",
route->name(), old_order, new_order));
sr->route->name(), sr->old_display_order, n));
}
if (changed) {

View file

@ -249,6 +249,7 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
void sync_order_keys_from_treeview ();
void sync_treeview_from_order_keys (ARDOUR::RouteSortOrderKey);
void reset_remote_control_ids ();
void reset_order_keys (ARDOUR::RouteSortOrderKey);
bool ignore_reorder;
void parameter_changed (std::string const &);

View file

@ -74,6 +74,8 @@ public:
void set_note (std::string const &);
virtual Gtk::Widget& tip_widget() = 0;
private:
void maybe_add_note (OptionEditorPage *, int);
@ -90,6 +92,8 @@ public:
void set_state_from_config () {}
void add_to_page (OptionEditorPage *);
Gtk::Widget& tip_widget() { return *_label; }
private:
Gtk::Label* _label; ///< the label used for the heading
};
@ -110,6 +114,8 @@ public:
void set_state_from_config () = 0;
void add_to_page (OptionEditorPage *);
Gtk::Widget& tip_widget() { return *_box->children().front().get_widget(); }
protected:
Gtk::VBox* _box; ///< constituent box for subclasses to add widgets to
@ -163,6 +169,8 @@ public:
_button->set_sensitive (yn);
}
Gtk::Widget& tip_widget() { return *_button; }
private:
void toggled ();
@ -181,6 +189,8 @@ public:
void set_state_from_config ();
void add_to_page (OptionEditorPage*);
Gtk::Widget& tip_widget() { return *_entry; }
private:
void activated ();
@ -263,6 +273,8 @@ public:
_combo->set_sensitive (yn);
}
Gtk::Widget& tip_widget() { return *_combo; }
private:
sigc::slot<T> _get;
@ -273,6 +285,118 @@ private:
};
/** Component which provides the UI for a GTK HScale.
*/
class HSliderOption : public Option
{
public:
/** Construct an ComboOption.
* @param i id
* @param n User-visible name.
* @param g Slot to get the variable's value.
* @param s Slot to set the variable's value.
*/
HSliderOption (
std::string const & i,
std::string const & n,
Gtk::Adjustment &adj
)
: Option (i, n)
{
_label = manage (new Gtk::Label (n + ":"));
_label->set_alignment (0, 0.5);
_hscale = manage (new Gtk::HScale(adj));
}
void set_state_from_config () { }
void add_to_page (OptionEditorPage* p)
{
add_widgets_to_page (p, _label, _hscale);
}
void set_sensitive (bool yn) {
_hscale->set_sensitive (yn);
}
Gtk::Widget& tip_widget() { return *_hscale; }
private:
Gtk::Label* _label;
Gtk::HScale* _hscale;
};
/** Component which provides the UI to handle an enumerated option using a GTK ComboBox.
* The template parameter is the enumeration.
*/
class ComboStringOption : public Option
{
public:
/** Construct an ComboOption.
* @param i id
* @param n User-visible name.
* @param g Slot to get the variable's value.
* @param s Slot to set the variable's value.
*/
ComboStringOption (
std::string const & i,
std::string const & n,
sigc::slot<std::string> g,
sigc::slot<bool, std::string> s
)
: Option (i, n),
_get (g),
_set (s)
{
_label = manage (new Gtk::Label (n + ":"));
_label->set_alignment (0, 0.5);
_combo = manage (new Gtk::ComboBoxText);
_combo->signal_changed().connect (sigc::mem_fun (*this, &ComboStringOption::changed));
}
void set_state_from_config () {
_combo->set_active_text (_get());
}
void add_to_page (OptionEditorPage* p)
{
add_widgets_to_page (p, _label, _combo);
}
/** Set the allowed strings for this option
* @param strings a vector of allowed strings
*/
void set_popdown_strings (const std::vector<std::string>& strings) {
_combo->clear_items ();
for (std::vector<std::string>::const_iterator i = strings.begin(); i != strings.end(); ++i) {
_combo->append_text (*i);
}
}
void clear () {
_combo->clear_items();
}
void changed () {
_set (_combo->get_active_text ());
}
void set_sensitive (bool yn) {
_combo->set_sensitive (yn);
}
Gtk::Widget& tip_widget() { return *_combo; }
private:
sigc::slot<std::string> _get;
sigc::slot<bool, std::string> _set;
Gtk::Label* _label;
Gtk::ComboBoxText* _combo;
};
/** Component which provides the UI to handle a boolean option which needs
* to be represented as a ComboBox to be clear to the user.
*/
@ -294,6 +418,8 @@ public:
void changed ();
void set_sensitive (bool);
Gtk::Widget& tip_widget() { return *_combo; }
private:
sigc::slot<bool> _get;
@ -370,6 +496,8 @@ public:
_set (static_cast<T> (_spin->get_value ()) * _scale);
}
Gtk::Widget& tip_widget() { return *_spin; }
private:
sigc::slot<T> _get;
sigc::slot<bool, T> _set;
@ -387,6 +515,8 @@ public:
void set_state_from_config ();
void add_to_page (OptionEditorPage *);
Gtk::Widget& tip_widget() { return *_db_slider; }
private:
void db_changed ();
@ -410,6 +540,8 @@ public:
void add_to_page (OptionEditorPage *);
void set_session (ARDOUR::Session *);
Gtk::Widget& tip_widget() { return _clock; }
private:
Gtk::Label _label;
AudioClock _clock;
@ -425,6 +557,8 @@ public:
void set_state_from_config ();
void add_to_page (OptionEditorPage *);
Gtk::Widget& tip_widget() { return _file_chooser; }
private:
void file_set ();
void current_folder_set ();

View file

@ -98,8 +98,9 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
{ "version", 0, 0, 'v' },
{ "help", 0, 0, 'h' },
{ "bindings", 0, 0, 'b' },
{ "disable-plugins", 1, 0, 'd' },
{ "debug", 1, 0, 'D' },
{ "show-splash", 0, 0, 'n' },
{ "no-splash", 0, 0, 'n' },
{ "menus", 1, 0, 'm' },
{ "name", 1, 0, 'c' },
{ "novst", 0, 0, 'V' },

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

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

9958
gtk2_ardour/po/zh.po Normal file

File diff suppressed because it is too large Load diff

View file

@ -31,6 +31,7 @@
#include "ardour/io_processor.h"
#include "ardour/session.h"
#include "ardour/user_bundle.h"
#include "ardour/port.h"
#include "control_protocol/control_protocol.h"
#include "gui_thread.h"
@ -422,6 +423,17 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
if (!inputs) {
ardour->add_bundle (session->the_auditioner()->output()->bundle());
ardour->add_bundle (session->click_io()->bundle());
/* Note: the LTC ports do not have the usual ":audio_out 1" postfix, so
* ardour->add_bundle (session->ltc_output_io()->bundle());
* won't work
*/
boost::shared_ptr<Bundle> ltc (new Bundle (_("LTC Out"), inputs));
ltc->add_channel (_("LTC Out"), DataType::AUDIO, session->engine().make_port_name_non_relative (session->ltc_output_port()->name()));
ardour->add_bundle (ltc);
} else {
boost::shared_ptr<Bundle> ltc (new Bundle (_("LTC In"), inputs));
ltc->add_channel (_("LTC In"), DataType::AUDIO, session->engine().make_port_name_non_relative (session->ltc_input_port()->name()));
ardour->add_bundle (ltc);
}
/* Ardour's surfaces */
@ -445,6 +457,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
boost::shared_ptr<Bundle> sync (new Bundle (_("Sync"), inputs));
MIDI::MachineControl* mmc = midi_manager->mmc ();
AudioEngine& ae = session->engine ();
if (inputs) {
sync->add_channel (
_("MTC in"), DataType::MIDI, ae.make_port_name_non_relative (midi_manager->mtc_input_port()->name())

View file

@ -1009,10 +1009,10 @@ PortMatrix::update_tab_highlighting ()
string c = label->get_label ();
if (c.length() && c[0] == '<' && !has_connection) {
/* this label is marked up with <b> but shouldn't be */
label->set_markup ((*j)->name);
label->set_text ((*j)->name);
} else if (c.length() && c[0] != '<' && has_connection) {
/* this label is not marked up with <b> but should be */
label->set_markup (string_compose ("<b>%1</b>", (*j)->name));
label->set_markup (string_compose ("<b>%1</b>", Glib::Markup::escape_text ((*j)->name)));
}
++p;

View file

@ -26,6 +26,7 @@
#include <gtkmm/scale.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/slider_controller.h>
#include <gtkmm2ext/gtk_ui.h>
#include "pbd/fpu.h"
#include "pbd/cpus.h"
@ -669,7 +670,11 @@ public:
_box->pack_start (*label, false, false);
label->show ();
_store->signal_row_changed().connect (sigc::mem_fun (*this, &ControlSurfacesOptions::model_changed));
ControlProtocolManager& m = ControlProtocolManager::instance ();
m.ProtocolStatusChange.connect (protocol_status_connection, MISSING_INVALIDATOR,
boost::bind (&ControlSurfacesOptions::protocol_status_changed, this, _1), gui_context());
_store->signal_row_changed().connect (sigc::mem_fun (*this, &ControlSurfacesOptions::view_changed));
_view.signal_button_press_event().connect_notify (sigc::mem_fun(*this, &ControlSurfacesOptions::edit_clicked));
}
@ -697,7 +702,18 @@ public:
private:
void model_changed (TreeModel::Path const &, TreeModel::iterator const & i)
void protocol_status_changed (ControlProtocolInfo* cpi) {
/* find the row */
TreeModel::Children rows = _store->children();
for (TreeModel::Children::iterator x = rows.begin(); x != rows.end(); ++x) {
if ((*x)[_model.protocol_info] == cpi) {
(*x)[_model.enabled] = (cpi->protocol || cpi->requested);
break;
}
}
}
void view_changed (TreeModel::Path const &, TreeModel::iterator const & i)
{
TreeModel::Row r = *i;
@ -793,6 +809,7 @@ private:
ControlSurfacesModelColumns _model;
TreeView _view;
Gtk::Window& _parent;
PBD::ScopedConnection protocol_status_connection;
};
/** A class which allows control of visibility of some editor components usign
@ -837,6 +854,8 @@ public:
add_widget_to_page (p, _visibility_group->list_view ());
}
Gtk::Widget& tip_widget() { return *_visibility_group->list_view (); }
private:
void changed ()
{
@ -956,61 +975,169 @@ RCOptionEditor::RCOptionEditor ()
/* TRANSPORT */
add_option (_("Transport"),
new BoolOption (
BoolOption* tsf;
tsf = new BoolOption (
"latched-record-enable",
_("Keep record-enable engaged on stop"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_latched_record_enable),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_latched_record_enable)
));
);
// Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(), _(""));
add_option (_("Transport"), tsf);
add_option (_("Transport"),
new BoolOption (
tsf = new BoolOption (
"stop-recording-on-xrun",
_("Stop recording when an xrun occurs"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_stop_recording_on_xrun),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_stop_recording_on_xrun)
));
);
Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(), _("<b>When enabled</b> Ardour will stop recording if an over- or underrun is detected by the audio engine"));
add_option (_("Transport"), tsf);
add_option (_("Transport"),
new BoolOption (
tsf = new BoolOption (
"create-xrun-marker",
_("Create markers where xruns occur"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_create_xrun_marker),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_create_xrun_marker)
));
);
// Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(), _(""));
add_option (_("Transport"), tsf);
add_option (_("Transport"),
new BoolOption (
tsf = new BoolOption (
"stop-at-session-end",
_("Stop at the end of the session"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_stop_at_session_end),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_stop_at_session_end)
));
);
Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(), _("<b>When enabled</b> if Ardour is <b>not recording</b>, it will stop the transport "
"when it reaches the current session end marker\n\n"
"<b>When disabled</b> Ardour will continue to roll past the session end marker at all times"));
add_option (_("Transport"), tsf);
add_option (_("Transport"),
new BoolOption (
tsf = new BoolOption (
"seamless-loop",
_("Do seamless looping (not possible when slaved to MTC, JACK etc)"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_seamless_loop),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_seamless_loop)
));
);
Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(), _("<b>When enabled</b> this will loop by reading ahead and wrapping around at the loop point, "
"preventing any need to do a transport locate at the end of the loop\n\n"
"<b>When disabled</b> looping is done by locating back to the start of the loop when Ardour reaches the end "
"which will often cause a small click or delay"));
add_option (_("Transport"), tsf);
add_option (_("Transport"),
new BoolOption (
tsf = new BoolOption (
"disable-disarm-during-roll",
_("Disable per-track record disarm while rolling"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_disable_disarm_during_roll),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_disable_disarm_during_roll)
));
);
Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(), _("<b>When enabled</b> this will prevent you from accidentally stopping specific tracks recording during a take"));
add_option (_("Transport"), tsf);
add_option (_("Transport"),
new BoolOption (
tsf = new BoolOption (
"quieten_at_speed",
_("12dB gain reduction during fast-forward and fast-rewind"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_quieten_at_speed),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_quieten_at_speed)
));
);
Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(), _("This will reduce the unpleasant increase in perceived volume "
"that occurs when fast-forwarding or rewinding through some kinds of audio"));
add_option (_("Transport"), tsf);
add_option (_("Transport"), new OptionEditorHeading (S_("Sync/Slave")));
_sync_source = new ComboOption<SyncSource> (
"sync-source",
_("External timecode source"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_sync_source),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_sync_source)
);
populate_sync_options ();
add_option (_("Transport"), _sync_source);
_sync_framerate = new BoolOption (
"timecode-sync-frame-rate",
_("Match session video frame rate to external timecode"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_timecode_sync_frame_rate),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_timecode_sync_frame_rate)
);
Gtkmm2ext::UI::instance()->set_tip
(_sync_framerate->tip_widget(),
_("This option controls the value of the video frame rate <i>while chasing</i> an external timecode source.\n\n"
"<b>When enabled</b> the session video frame rate will be changed to match that of the selected external timecode source.\n\n"
"<b>When disabled</b> the session video frame rate will not be changed to match that of the selected external timecode source."
"Instead the frame rate indication in the main clock will flash red and Ardour will convert between the external "
"timecode standard and the session standard"));
add_option (_("Transport"), _sync_framerate);
_sync_genlock = new BoolOption (
"timecode-source-is-synced",
_("External timecode is sync locked"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_timecode_source_is_synced),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_timecode_source_is_synced)
);
Gtkmm2ext::UI::instance()->set_tip
(_sync_genlock->tip_widget(),
_("<b>When enabled</b> indicates that the selected external timecode source shares sync (Black &amp; Burst, Wordclock, etc) with the audio interface"));
add_option (_("Transport"), _sync_genlock);
_ltc_port = new ComboStringOption (
"ltc-source-port",
_("LTC incoming port"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_ltc_source_port),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_ltc_source_port)
);
vector<string> physical_inputs;
physical_inputs.push_back (_("None"));
AudioEngine::instance()->get_physical_inputs (DataType::AUDIO, physical_inputs);
_ltc_port->set_popdown_strings (physical_inputs);
add_option (_("Transport"), _ltc_port);
#ifdef HAVE_LTC
// TODO; rather disable this button than not compile it..
add_option (_("Transport"), new OptionEditorHeading (S_("LTC Generator")));
add_option (_("Transport"),
new BoolOption (
"send-ltc",
_("Enable LTC generator"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_send_ltc),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_ltc)
));
_ltc_send_continuously = new BoolOption (
"ltc-send-continuously",
_("send LTC while stopped"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_ltc_send_continuously),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_ltc_send_continuously)
);
Gtkmm2ext::UI::instance()->set_tip
(_ltc_send_continuously->tip_widget(),
_("<b>When enabled</b> Ardour will continue to send LTC information even when the transport (playhead) is not moving"));
add_option (_("Transport"), _ltc_send_continuously);
_ltc_volume_adjustment = new Gtk::Adjustment(-18, -50, 0, .5, 5);
_ltc_volume_adjustment->set_value (20 * log10(_rc_config->get_ltc_output_volume()));
_ltc_volume_adjustment->signal_value_changed().connect (sigc::mem_fun (*this, &RCOptionEditor::ltc_generator_volume_changed));
_ltc_volume_slider = new HSliderOption("ltcvol", ("LTC generator level:"), *_ltc_volume_adjustment);
Gtkmm2ext::UI::instance()->set_tip
(_ltc_volume_slider->tip_widget(),
_("Specify the Peak Volume of the generated LTC signal in dbFS. A good value is 0dBu ^= -18dbFS in an EBU calibrated system"));
add_option (_("Transport"), _ltc_volume_slider);
#endif
parameter_changed ("sync-source");
parameter_changed ("send-ltc");
/* EDITOR */
@ -1554,7 +1681,7 @@ RCOptionEditor::RCOptionEditor ()
/* INTERFACE */
add_option (S_("Visual|Interface"),
add_option (S_("GUI"),
new BoolOption (
"widget-prelight",
_("Graphically indicate mouse pointer hovering over various widgets"),
@ -1564,9 +1691,9 @@ RCOptionEditor::RCOptionEditor ()
#ifndef GTKOSX
/* font scaling does nothing with GDK/Quartz */
add_option (S_("Visual|Interface"), new FontScalingOptions (_rc_config));
add_option (S_("GUI"), new FontScalingOptions (_rc_config));
#endif
add_option (S_("Visual|Interface"),
add_option (S_("GUI"),
new BoolOption (
"use-own-plugin-gui",
_("Use plugins' own interfaces instead of Ardour's"),
@ -1585,7 +1712,7 @@ RCOptionEditor::RCOptionEditor ()
_mixer_strip_visibility.add (0, X_("MeterPoint"), _("Meter Point"));
add_option (
S_("Visual|Interface"),
S_("GUI"),
new VisibilityOption (
_("Mixer Strip"),
&_mixer_strip_visibility,
@ -1594,7 +1721,7 @@ RCOptionEditor::RCOptionEditor ()
)
);
add_option (S_("Visual|Interface"),
add_option (S_("GUI"),
new BoolOption (
"default-narrow_ms",
_("Use narrow strips in the mixer by default"),
@ -1602,7 +1729,7 @@ RCOptionEditor::RCOptionEditor ()
sigc::mem_fun (*_rc_config, &RCConfiguration::set_default_narrow_ms)
));
add_option (S_("Visual|Interface"), new OptionEditorHeading (_("Metering")));
add_option (S_("GUI"), new OptionEditorHeading (_("Metering")));
ComboOption<float>* mht = new ComboOption<float> (
"meter-hold",
@ -1616,7 +1743,7 @@ RCOptionEditor::RCOptionEditor ()
mht->add (MeterHoldMedium, _("medium"));
mht->add (MeterHoldLong, _("long"));
add_option (S_("Visual|Interface"), mht);
add_option (S_("GUI"), mht);
ComboOption<float>* mfo = new ComboOption<float> (
"meter-falloff",
@ -1633,7 +1760,7 @@ RCOptionEditor::RCOptionEditor ()
mfo->add (METER_FALLOFF_FASTER, _("faster"));
mfo->add (METER_FALLOFF_FASTEST, _("fastest"));
add_option (S_("Visual|Interface"), mfo);
add_option (S_("GUI"), mfo);
}
void
@ -1649,5 +1776,39 @@ RCOptionEditor::parameter_changed (string const & p)
}
_solo_control_is_listen_control->set_sensitive (s);
_listen_position->set_sensitive (s);
} else if (p == "sync-source") {
switch(Config->get_sync_source()) {
case ARDOUR::MTC:
case ARDOUR::LTC:
_sync_genlock->set_sensitive (true);
_sync_framerate->set_sensitive (true);
break;
default:
_sync_genlock->set_sensitive (false);
_sync_framerate->set_sensitive (false);
break;
}
#ifdef HAVE_LTC
} else if (p == "send-ltc") {
bool const s = Config->get_send_ltc ();
_ltc_send_continuously->set_sensitive (s);
_ltc_volume_slider->set_sensitive (s);
#endif /*HAVE_LTC*/
}
}
void RCOptionEditor::ltc_generator_volume_changed () {
_rc_config->set_ltc_output_volume (pow(10, _ltc_volume_adjustment->get_value() / 20));
}
void
RCOptionEditor::populate_sync_options ()
{
vector<SyncSource> sync_opts = ARDOUR::get_available_sync_options ();
_sync_source->clear ();
for (vector<SyncSource>::iterator i = sync_opts.begin(); i != sync_opts.end(); ++i) {
_sync_source->add (*i, sync_source_to_string (*i));
}
}

View file

@ -34,10 +34,22 @@ class RCOptionEditor : public OptionEditor
public:
RCOptionEditor ();
void populate_sync_options ();
private:
void parameter_changed (std::string const &);
void ltc_generator_volume_changed ();
ARDOUR::RCConfiguration* _rc_config;
BoolOption* _solo_control_is_listen_control;
ComboOption<ARDOUR::ListenPosition>* _listen_position;
VisibilityGroup _mixer_strip_visibility;
ComboOption<ARDOUR::SyncSource>* _sync_source;
BoolOption* _sync_framerate;
BoolOption* _sync_genlock;
ComboStringOption* _ltc_port;
HSliderOption* _ltc_volume_slider;
Gtk::Adjustment* _ltc_volume_adjustment;
BoolOption* _ltc_send_continuously;
PBD::ScopedConnection parameter_change_connection;
};

View file

@ -0,0 +1,50 @@
/*
Copyright (C) 2012 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __gtk2_ardour_route_sorter_h__
#define __gtk2_ardour_route_sorter_h__
#include <boost/shared_ptr.hpp>
#include <stdint.h>
#include <vector>
namespace ARDOUR {
class Route;
}
struct RoutePlusOrderKey {
boost::shared_ptr<ARDOUR::Route> route; /* we don't really need this, but its handy to keep around */
uint32_t old_display_order;
uint32_t new_display_order;
RoutePlusOrderKey (boost::shared_ptr<ARDOUR::Route> r, uint32_t ok, uint32_t nk)
: route (r)
, old_display_order (ok)
, new_display_order (nk) {}
};
typedef std::vector<RoutePlusOrderKey> OrderKeySortedRoutes;
struct SortByNewDisplayOrder {
bool operator() (const RoutePlusOrderKey& a, const RoutePlusOrderKey& b) {
return a.new_display_order < b.new_display_order;
}
};
#endif /* __gtk2_ardour_route_sorter_h__ */

View file

@ -74,7 +74,7 @@ SearchPathOption::add_to_page (OptionEditorPage* p)
Label* label = manage (new Label);
label->set_alignment (0.0, 0.0);
label->set_markup (string_compose ("%1", _name));
label->set_text (string_compose ("%1", _name));
p->table.attach (*label, 1, 2, n, n + 1, FILL | EXPAND);
p->table.attach (vbox, 2, 3, n, n + 1, FILL | EXPAND);

View file

@ -40,6 +40,8 @@ class SearchPathOption : public Option
void add_to_page (OptionEditorPage*);
void clear ();
Gtk::Widget& tip_widget() { return add_chooser; }
protected:
sigc::slot<std::string> _get; ///< slot to get the configuration variable's value
sigc::slot<bool, std::string> _set; ///< slot to set the configuration variable's value

View file

@ -26,6 +26,7 @@
using namespace std;
using namespace ARDOUR;
using namespace Timecode;
SessionOptionEditor::SessionOptionEditor (Session* s)
: OptionEditor (&(s->config), _("Session Properties"))
@ -37,18 +38,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
/* TIMECODE*/
_sync_source = new ComboOption<SyncSource> (
"sync-source",
_("External timecode source"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_sync_source),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_sync_source)
);
populate_sync_options ();
parameter_changed (string ("external-sync"));
add_option (_("Timecode"), _sync_source);
add_option (_("Timecode"), new OptionEditorHeading (_("Timecode Settings")));
ComboOption<TimecodeFormat>* smf = new ComboOption<TimecodeFormat> (
@ -83,13 +72,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
add_option (_("Timecode"), spf);
add_option (_("Timecode"), new BoolOption (
"timecode-source-is-synced",
_("Timecode source shares sample clock with audio interface"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_source_is_synced),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_source_is_synced)
));
ComboOption<float>* vpu = new ComboOption<float> (
"video-pullup",
_("Pull-up / pull-down"),
@ -306,26 +288,10 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
));
}
void
SessionOptionEditor::populate_sync_options ()
{
vector<SyncSource> sync_opts = _session->get_available_sync_options ();
_sync_source->clear ();
for (vector<SyncSource>::iterator i = sync_opts.begin(); i != sync_opts.end(); ++i) {
_sync_source->add (*i, sync_source_to_string (*i));
}
}
void
SessionOptionEditor::parameter_changed (std::string const & p)
{
OptionEditor::parameter_changed (p);
if (p == "external-sync") {
_sync_source->set_sensitive (!_session->config.get_external_sync ());
}
}
/* the presence of absence of a monitor section is not really a regular session

View file

@ -31,10 +31,8 @@ public:
private:
void parameter_changed (std::string const &);
void populate_sync_options ();
ARDOUR::SessionConfiguration* _session_config;
ComboOption<ARDOUR::SyncSource>* _sync_source;
bool set_use_monitor_section (bool);
bool get_use_monitor_section ();

View file

@ -248,7 +248,7 @@ SoundFileBox::setup_labels (const string& filename)
return false;
}
preview_label.set_markup (string_compose ("<b>%1</b>", Glib::path_get_basename (filename)));
preview_label.set_markup (string_compose ("<b>%1</b>", Glib::Markup::escape_text (Glib::path_get_basename (filename))));
std::string n = sf_info.format_name;
if (n.substr (0, 8) == X_("Format: ")) {
n = n.substr (8);
@ -1400,16 +1400,16 @@ SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Sessi
where_combo.set_active_text (str.front());
Label* l = manage (new Label);
l->set_text (_("Add files:"));
l->set_markup (_("<b>Add files as ...</b>"));
hbox = manage (new HBox);
hbox->set_border_width (12);
hbox->set_spacing (6);
hbox->pack_start (*l, false, false);
hbox->pack_start (action_combo, false, false);
vbox = manage (new VBox);
vbox->pack_start (*hbox, false, false);
options.pack_start (*vbox, false, false);
vbox->set_border_width (12);
vbox->set_spacing (6);
vbox->pack_start (*l, false, false);
vbox->pack_start (action_combo, false, false);
hbox = manage (new HBox);
hbox->pack_start (*vbox, false, false);
options.pack_start (*hbox, false, false);
/* dummy entry for action combo so that it doesn't look odd if we
come up with no tracks selected.
@ -1422,29 +1422,29 @@ SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Sessi
action_combo.set_sensitive (false);
l = manage (new Label);
l->set_text (_("Insert at:"));
l->set_markup (_("<b>Insert at</b>"));
hbox = manage (new HBox);
hbox->set_border_width (12);
hbox->set_spacing (6);
hbox->pack_start (*l, false, false);
hbox->pack_start (where_combo, false, false);
vbox = manage (new VBox);
vbox->pack_start (*hbox, false, false);
options.pack_start (*vbox, false, false);
vbox->set_border_width (12);
vbox->set_spacing (6);
vbox->pack_start (*l, false, false);
vbox->pack_start (where_combo, false, false);
hbox = manage (new HBox);
hbox->pack_start (*vbox, false, false);
options.pack_start (*hbox, false, false);
l = manage (new Label);
l->set_text (_("Mapping:"));
l->set_markup (_("<b>Mapping</b>"));
hbox = manage (new HBox);
hbox->set_border_width (12);
hbox->set_spacing (6);
hbox->pack_start (*l, false, false);
hbox->pack_start (channel_combo, false, false);
vbox = manage (new VBox);
vbox->pack_start (*hbox, false, false);
options.pack_start (*vbox, false, false);
vbox->set_border_width (12);
vbox->set_spacing (6);
vbox->pack_start (*l, false, false);
vbox->pack_start (channel_combo, false, false);
hbox = manage (new HBox);
hbox->pack_start (*vbox, false, false);
options.pack_start (*hbox, false, false);
str.clear ();
str.push_back (_("one track per file"));
@ -1453,16 +1453,16 @@ SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Sessi
channel_combo.set_sensitive (false);
l = manage (new Label);
l->set_text (_("Conversion quality:"));
l->set_markup (_("<b>Conversion quality</b>"));
hbox = manage (new HBox);
hbox->set_border_width (12);
hbox->set_spacing (6);
hbox->pack_start (*l, false, false);
hbox->pack_start (src_combo, false, false);
vbox = manage (new VBox);
vbox->pack_start (*hbox, false, false);
options.pack_start (*vbox, false, false);
vbox->set_border_width (12);
vbox->set_spacing (6);
vbox->pack_start (*l, false, false);
vbox->pack_start (src_combo, false, false);
hbox = manage (new HBox);
hbox->pack_start (*vbox, false, false);
options.pack_start (*hbox, false, false);
str.clear ();
str.push_back (_("Best"));
@ -1482,6 +1482,13 @@ SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Sessi
copy_files_btn.set_active (true);
Gtk::Label* copy_label = dynamic_cast<Gtk::Label*>(copy_files_btn.get_child());
if (copy_label) {
copy_label->set_size_request (175, -1);
copy_label->set_line_wrap (true);
}
block_four.pack_start (copy_files_btn, false, false);
options.pack_start (block_four, false, false);

View file

@ -78,6 +78,7 @@ Splash::Splash ()
add (darea);
set_default_size (pixbuf->get_width(), pixbuf->get_height());
set_resizable (false);
the_splash = this;
expose_done = false;
@ -187,7 +188,7 @@ void
Splash::message (const string& msg)
{
string str ("<b>");
str += msg;
str += Glib::Markup::escape_text (msg);
str += "</b>";
layout->set_markup (str);

View file

@ -922,6 +922,8 @@ ArdourStartup::redisplay_recent_sessions ()
for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) {
session_directories.push_back ((*i).second);
}
int session_snapshot_count = 0;
for (vector<std::string>::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i)
{
@ -960,6 +962,8 @@ ArdourStartup::redisplay_recent_sessions ()
row[recent_session_columns.visible_name] = Glib::path_get_basename (fullpath);
row[recent_session_columns.fullpath] = fullpath;
++session_snapshot_count;
if (state_file_names.size() > 1) {
@ -973,13 +977,15 @@ ArdourStartup::redisplay_recent_sessions ()
child_row[recent_session_columns.visible_name] = *i2;
child_row[recent_session_columns.fullpath] = fullpath;
++session_snapshot_count;
}
}
}
recent_session_display.set_tooltip_column(1); // recent_session_columns.fullpath
recent_session_display.set_model (recent_session_model);
return rs.size();
return session_snapshot_count;
// return rs.size();
}
void
@ -1115,7 +1121,7 @@ ArdourStartup::setup_more_options_page ()
advanced_table.set_row_spacings(0);
advanced_table.set_col_spacings(0);
_connect_inputs.set_label (_("Automatically connect to physical_inputs"));
_connect_inputs.set_label (_("Automatically connect to physical inputs"));
_connect_inputs.set_flags(Gtk::CAN_FOCUS);
_connect_inputs.set_relief(Gtk::RELIEF_NORMAL);
_connect_inputs.set_mode(true);
@ -1250,10 +1256,11 @@ ArdourStartup::setup_more_options_page ()
_limit_output_ports.signal_clicked().connect (sigc::mem_fun (*this, &ArdourStartup::limit_outputs_clicked));
_create_master_bus.signal_clicked().connect (sigc::mem_fun (*this, &ArdourStartup::master_bus_button_clicked));
/* note that more_options_vbox is NOT visible by
* default. this is entirely by design - this page
* should be skipped unless explicitly requested.
/* note that more_options_vbox is "visible" by default even
* though it may not be displayed to the user, this is so the dialog
* doesn't resize.
*/
more_options_vbox.show_all ();
session_options_page_index = append_page (more_options_vbox);
set_page_title (more_options_vbox, _("Advanced Session Options"));
@ -1335,9 +1342,12 @@ ArdourStartup::connect_inputs_clicked ()
void
ArdourStartup::connect_outputs_clicked ()
{
_limit_output_ports.set_sensitive(_connect_outputs.get_active());
bool const co = _connect_outputs.get_active ();
_limit_output_ports.set_sensitive(co);
_connect_outputs_to_master.set_sensitive(co);
_connect_outputs_to_physical.set_sensitive(co);
if (_connect_outputs.get_active() && _limit_output_ports.get_active()) {
if (co && _limit_output_ports.get_active()) {
_output_limit_count.set_sensitive(true);
} else {
_output_limit_count.set_sensitive(false);
@ -1359,9 +1369,10 @@ ArdourStartup::limit_outputs_clicked ()
void
ArdourStartup::master_bus_button_clicked ()
{
bool yn = _create_master_bus.get_active();
bool const yn = _create_master_bus.get_active();
_master_bus_channel_count.set_sensitive(yn);
_connect_outputs_to_master.set_sensitive(yn);
}
void

View file

@ -226,13 +226,13 @@ get_font_for_style (string widgetname)
Glib::RefPtr<const Pango::Layout> layout = foobar.get_layout();
PangoFontDescription *pfd = (PangoFontDescription *)pango_layout_get_font_description((PangoLayout *)layout->gobj());
PangoFontDescription *pfd = (PangoFontDescription *)pango_layout_get_font_description(const_cast<PangoLayout *>(layout->gobj()));
if (!pfd) {
/* layout inherited its font description from a PangoContext */
PangoContext* ctxt = (PangoContext*) pango_layout_get_context ((PangoLayout*) layout->gobj());
PangoContext* ctxt = (PangoContext*) pango_layout_get_context (const_cast<PangoLayout*>(layout->gobj()));
pfd = pango_context_get_font_description (ctxt);
return Pango::FontDescription (pfd); /* make a copy */
}

View file

@ -419,21 +419,24 @@ def build(bld):
if bld.is_defined('HAVE_SUIL'):
obj.source += [ 'lv2_plugin_ui.cc' ]
obj.uselib += ' SUIL '
obj.use += [ 'SUIL' ]
if bld.is_defined('FREESOUND'):
obj.source += [ 'sfdb_freesound_mootcher.cc' ]
obj.defines += [ 'FREESOUND' ]
if bld.is_defined('NEED_INTL'):
obj.linkflags = ' -lintl'
if bld.is_defined('WINDOWS_VST_SUPPORT'):
obj.source += [ 'windows_vst_plugin_ui.cc' ]
obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
obj.uselib += ' X11 '
obj.use += [ 'X11' ]
if bld.is_defined('LXVST_SUPPORT'):
obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
obj.defines += [ 'LXVST_SUPPORT' ]
obj.uselib += ' X11 '
obj.use += [ 'X11' ]
if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
obj.source += [ 'vst_plugin_ui.cc' ]

View file

@ -22,6 +22,7 @@
#include <map>
#include <string>
#include <vector>
#include <limits.h>
#include <signal.h>
@ -68,6 +69,7 @@ namespace ARDOUR {
}
void setup_fpu ();
std::vector<SyncSource> get_available_sync_options();
}
#endif /* __ardour_ardour_h__ */

View file

@ -52,7 +52,7 @@ public:
assert(src.type() == DataType::AUDIO);
assert(len <= _capacity);
assert( src_offset <= ((framecnt_t) src.capacity()-len));
memcpy(_data + dst_offset, ((AudioBuffer&)src).data() + src_offset, sizeof(Sample) * len);
memcpy(_data + dst_offset, ((const AudioBuffer&)src).data() + src_offset, sizeof(Sample) * len);
if (dst_offset == 0 && src_offset == 0 && len == _capacity) {
_silent = src.silent();
} else {

View file

@ -321,6 +321,7 @@ private:
int jack_bufsize_callback (pframes_t);
int jack_sample_rate_callback (pframes_t);
void freewheel_callback (int);
void connect_callback (jack_port_id_t, jack_port_id_t, int);
void set_jack_callbacks ();
@ -348,6 +349,8 @@ private:
};
static void* _start_process_thread (void*);
void parameter_changed (const std::string&);
PBD::ScopedConnection config_connection;
};
} // namespace ARDOUR

View file

@ -96,7 +96,7 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
void start_touch (double when);
void stop_touch (bool mark, double when);
bool touching() const { return g_atomic_int_get (&_touching); }
bool touching() const { return g_atomic_int_get (const_cast<gint*>(&_touching)); }
bool writing() const { return _state == Write; }
bool touch_enabled() const { return _state == Touch; }

View file

@ -72,11 +72,11 @@ class ControlProtocolManager : public PBD::Stateful, public ARDOUR::SessionHandl
static const std::string state_node_name;
void set_protocol_states (const XMLNode&);
int set_state (const XMLNode&, int version);
XMLNode& get_state (void);
PBD::Signal1<void,ControlProtocolInfo*> ProtocolStatusChange;
private:
ControlProtocolManager ();
static ControlProtocolManager* _instance;

View file

@ -39,6 +39,7 @@ namespace PBD {
extern uint64_t Graph;
extern uint64_t Destruction;
extern uint64_t MTC;
extern uint64_t LTC;
extern uint64_t Transport;
extern uint64_t Slave;
extern uint64_t SessionEvents;

View file

@ -94,6 +94,7 @@ class ExportFormatBase {
enum SampleRate {
SR_None = 0,
SR_Session = 1,
SR_8 = 8000,
SR_22_05 = 220500,
SR_44_1 = 44100,
SR_48 = 48000,

View file

@ -94,7 +94,7 @@ class IO : public SessionObject, public Latent
int ensure_io (ChanCount cnt, bool clear, void *src);
int connect_ports_to_bundle (boost::shared_ptr<Bundle>, void *);
int connect_ports_to_bundle (boost::shared_ptr<Bundle>, bool exclusive, void *);
int disconnect_ports_from_bundle (boost::shared_ptr<Bundle>, void *);
BundleList bundles_connected ();

View file

@ -46,7 +46,7 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
public:
LV2Plugin (ARDOUR::AudioEngine& engine,
ARDOUR::Session& session,
void* c_plugin,
const void* c_plugin,
framecnt_t sample_rate);
LV2Plugin (const LV2Plugin &);
~LV2Plugin ();
@ -70,9 +70,9 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
const void* extension_data (const char* uri) const;
void* c_plugin();
void* c_ui();
void* c_ui_type();
const void* c_plugin();
const void* c_ui();
const void* c_ui_type();
bool is_external_ui () const;
bool ui_is_resizable () const;
@ -126,7 +126,10 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
uint32_t atom_eventTransfer() const;
void write_from_ui(uint32_t index, uint32_t protocol, uint32_t size, uint8_t* body);
void write_from_ui(uint32_t index,
uint32_t protocol,
uint32_t size,
const uint8_t* body);
typedef void UIMessageSink(void* controller,
uint32_t index,
@ -149,6 +152,9 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
static uint32_t _sequence_type;
static uint32_t _event_transfer_type;
static uint32_t _path_type;
static uint32_t _log_Error;
static uint32_t _log_Warning;
static uint32_t _log_Note;
private:
struct Impl;
@ -161,6 +167,7 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
float* _shadow_data;
float* _defaults;
LV2_Evbuf** _ev_buffers;
LV2_Evbuf** _atom_ev_buffers;
float* _bpm_control_port; ///< Special input set by ardour
float* _freewheel_control_port; ///< Special input set by ardour
float* _latency_control_port; ///< Special output set by ardour
@ -177,7 +184,8 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
PORT_AUDIO = 1 << 2,
PORT_CONTROL = 1 << 3,
PORT_EVENT = 1 << 4,
PORT_MESSAGE = 1 << 5
PORT_MESSAGE = 1 << 5,
PORT_ATOM = 1 << 6
} PortFlag;
typedef unsigned PortFlags;
@ -192,16 +200,16 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
uint32_t size;
};
void write_to_ui(uint32_t index,
uint32_t protocol,
uint32_t size,
uint8_t* body);
void write_to_ui(uint32_t index,
uint32_t protocol,
uint32_t size,
const uint8_t* body);
void write_to(RingBuffer<uint8_t>* dest,
uint32_t index,
uint32_t protocol,
uint32_t size,
uint8_t* body);
const uint8_t* body);
// Created on demand so the space is only consumed if necessary
RingBuffer<uint8_t>* _to_ui;
@ -215,7 +223,13 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
LV2_Feature _data_access_feature;
LV2_Feature _instance_access_feature;
LV2_Feature _make_path_feature;
LV2_Feature _log_feature;
LV2_Feature _work_schedule_feature;
LV2_Feature _options_feature;
// Options passed to plugin
int32_t _block_length;
int32_t _seq_size;
mutable unsigned _state_version;
@ -230,7 +244,8 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
static char* lv2_state_make_path (void* host_data,
const char* path);
void init (void* c_plugin, framecnt_t rate);
void init (const void* c_plugin, framecnt_t rate);
void allocate_atom_event_buffers ();
void run (pframes_t nsamples);
void latency_compute_run ();
@ -243,14 +258,14 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
class LV2PluginInfo : public PluginInfo {
public:
LV2PluginInfo (void* c_plugin);
LV2PluginInfo (const void* c_plugin);
~LV2PluginInfo ();
static PluginInfoList* discover ();
PluginPtr load (Session& session);
void* _c_plugin;
const void* _c_plugin;
};
typedef boost::shared_ptr<LV2PluginInfo> LV2PluginInfoPtr;

View file

@ -152,6 +152,7 @@ public:
int set_state (const XMLNode&, int version);
XMLNode & get_state ();
void remove (SysExPtr sysex);
void operator() ();
void undo ();
@ -168,6 +169,8 @@ public:
typedef std::list<Change> ChangeList;
ChangeList _changes;
std::list<SysExPtr> _removed;
XMLNode & marshal_change (const Change &);
Change unmarshal_change (XMLNode *);
};

View file

@ -54,8 +54,10 @@ public:
inline bool read_contents(uint32_t size, uint8_t* buf);
size_t read(MidiBuffer& dst, framepos_t start, framepos_t end, framecnt_t offset=0, bool stop_on_overflow_in_destination=false);
inline uint32_t write(T time, Evoral::EventType type, uint32_t size, const uint8_t* buf);
void dump(std::ostream& dst);
void flush (framepos_t start, framepos_t end);
void flush (framepos_t start, framepos_t end);
/** Set the channel filtering mode.
* @param mask If mode is FilterChannels, each bit represents a midi channel:
@ -135,6 +137,37 @@ MidiRingBuffer<T>::read_contents(uint32_t size, uint8_t* buf)
return PBD::RingBufferNPT<uint8_t>::read(buf, size) == size;
}
template<typename T>
inline uint32_t
MidiRingBuffer<T>::write(T time, Evoral::EventType type, uint32_t size, const uint8_t* buf)
{
assert(size > 0);
uint8_t status = buf[0];
// Ignore event if it doesn't match channel filter
if (is_channel_event(status)) {
ChannelMode mode = get_channel_mode();
if (mode == FilterChannels) {
const uint8_t channel = status & 0x0F;
if (!(get_channel_mask() & (1L << channel))) {
return 0;
}
} else if (mode == ForceChannel) {
uint8_t* tmpbuf = (uint8_t*) malloc(size);
assert(tmpbuf);
memcpy(tmpbuf, buf, size);
tmpbuf[0] = (tmpbuf[0] & 0xF0) | (get_channel_mask() & 0x0F);
uint32_t bytes_written = Evoral::EventRingBuffer<T>::write(time, type, size, tmpbuf);
free(tmpbuf);
return bytes_written;
}
}
return Evoral::EventRingBuffer<T>::write(time, type, size, buf);
}
} // namespace ARDOUR

View file

@ -72,7 +72,7 @@ class Pannable : public PBD::Stateful, public Automatable, public SessionHandleR
void start_touch (double when);
void stop_touch (bool mark, double when);
bool touching() const { return g_atomic_int_get (&_touching); }
bool touching() const { return g_atomic_int_get (const_cast<gint*>(&_touching)); }
bool writing() const { return _auto_state == Write; }
bool touch_enabled() const { return _auto_state == Touch; }

View file

@ -43,9 +43,20 @@ CONFIG_VARIABLE (bool, midi_feedback, "midi-feedback", false)
CONFIG_VARIABLE (int32_t, mmc_receive_device_id, "mmc-receive-device-id", 0x7f)
CONFIG_VARIABLE (int32_t, mmc_send_device_id, "mmc-send-device-id", 0)
CONFIG_VARIABLE (int32_t, initial_program_change, "initial-program-change", -1)
CONFIG_VARIABLE (int, mtc_qf_speed_tolerance, "mtc-qf-speed-tolerance", 5)
CONFIG_VARIABLE (bool, first_midi_bank_is_zero, "diplay-first-midi-bank-as-zero", false)
/* Timecode and related */
CONFIG_VARIABLE (int, mtc_qf_speed_tolerance, "mtc-qf-speed-tolerance", 5)
CONFIG_VARIABLE (bool, timecode_sync_frame_rate, "timecode-sync-frame-rate", true)
CONFIG_VARIABLE (bool, timecode_source_is_synced, "timecode-source-is-synced", true)
CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK)
CONFIG_VARIABLE (std::string, ltc_source_port, "ltc-source-port", "system:capture_1")
CONFIG_VARIABLE (bool, send_ltc, "send-ltc", false)
CONFIG_VARIABLE (bool, ltc_send_continuously, "ltc-send-continuously", true)
CONFIG_VARIABLE (std::string, ltc_output_port, "ltc-output-port", "")
CONFIG_VARIABLE (float, ltc_output_volume, "ltc-output-volume", 0.125893)
/* control surfaces */
CONFIG_VARIABLE (uint32_t, feedback_interval_ms, "feedback-interval-ms", 100)

View file

@ -167,7 +167,7 @@ class Region
bool automatic () const { return _automatic; }
bool whole_file () const { return _whole_file; }
bool captured () const { return !(_import || _external); }
bool can_move () const { return !_position_locked; }
bool can_move () const { return !_position_locked && !_locked; }
bool sync_marked () const { return _sync_marked; }
bool external () const { return _external; }
bool import () const { return _import; }

View file

@ -64,6 +64,10 @@
#include <jack/session.h>
#endif
#ifdef HAVE_LTC
#include <ltc.h>
#endif
class XMLTree;
class XMLNode;
struct _AEffect;
@ -503,9 +507,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
static PBD::Signal1<void, framepos_t> StartTimeChanged;
static PBD::Signal1<void, framepos_t> EndTimeChanged;
std::vector<SyncSource> get_available_sync_options() const;
void request_sync_source (Slave*);
bool synced_to_jack() const { return config.get_external_sync() && config.get_sync_source() == JACK; }
bool synced_to_jack() const { return config.get_external_sync() && Config->get_sync_source() == JACK; }
double transport_speed() const { return _transport_speed; }
bool transport_stopped() const { return _transport_speed == 0.0f; }
@ -801,6 +804,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
};
SlaveState slave_state() const { return _slave_state; }
Slave* slave() const { return _slave; }
boost::shared_ptr<SessionPlaylists> playlists;
@ -843,6 +847,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/** Emitted when the session wants Ardour to quit */
static PBD::Signal0<void> Quit;
boost::shared_ptr<Port> ltc_input_port() const;
boost::shared_ptr<Port> ltc_output_port() const;
boost::shared_ptr<IO> ltc_input_io() { return _ltc_input; }
boost::shared_ptr<IO> ltc_output_io() { return _ltc_output; }
protected:
friend class AudioEngine;
void set_block_size (pframes_t nframes);
@ -964,6 +974,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
framepos_t post_export_position;
bool _exporting;
bool _export_started;
bool _export_rolling;
boost::shared_ptr<ExportHandler> export_handler;
@ -1064,7 +1075,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
PostTransportClearSubstate);
gint _post_transport_work; /* accessed only atomic ops */
PostTransportWork post_transport_work() const { return (PostTransportWork) g_atomic_int_get (&_post_transport_work); }
PostTransportWork post_transport_work() const { return (PostTransportWork) g_atomic_int_get (const_cast<gint*>(&_post_transport_work)); }
void set_post_transport_work (PostTransportWork ptw) { g_atomic_int_set (&_post_transport_work, (gint) ptw); }
void add_post_transport_work (PostTransportWork ptw);
@ -1177,6 +1188,30 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
int send_midi_time_code_for_cycle (framepos_t, framepos_t, pframes_t nframes);
#ifdef HAVE_LTC
LTCEncoder* ltc_encoder;
ltcsnd_sample_t* ltc_enc_buf;
Timecode::TimecodeFormat ltc_enc_tcformat;
int32_t ltc_buf_off;
int32_t ltc_buf_len;
double ltc_speed;
int32_t ltc_enc_byte;
framepos_t ltc_enc_pos;
double ltc_enc_cnt;
framepos_t ltc_enc_off;
jack_latency_range_t ltc_out_latency;
void ltc_tx_initialize();
void ltc_tx_cleanup();
void ltc_tx_reset();
void ltc_tx_resync_latency();
void ltc_tx_recalculate_position();
void ltc_tx_send_time_code_for_cycle (framepos_t, framepos_t, double, double, pframes_t nframes);
#endif
void reset_record_status ();
int no_roll (pframes_t nframes);
@ -1528,6 +1563,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
bool ignore_route_processor_changes;
MidiClockTicker* midi_clock;
boost::shared_ptr<IO> _ltc_input;
boost::shared_ptr<IO> _ltc_output;
void reconnect_ltc_input ();
void reconnect_ltc_output ();
};
} // namespace ARDOUR

View file

@ -40,20 +40,18 @@ CONFIG_VARIABLE (bool, auto_input, "auto-input", true)
CONFIG_VARIABLE (bool, punch_in, "punch-in", false)
CONFIG_VARIABLE (bool, punch_out, "punch-out", false)
CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
CONFIG_VARIABLE (TimecodeFormat, timecode_format, "timecode-format", timecode_30)
CONFIG_VARIABLE (Timecode::TimecodeFormat, timecode_format, "timecode-format", Timecode::timecode_30)
CONFIG_VARIABLE_SPECIAL(std::string, raid_path, "raid-path", "", path_expand)
CONFIG_VARIABLE_SPECIAL(std::string, audio_search_path, "audio-search-path", "", search_path_expand)
CONFIG_VARIABLE_SPECIAL(std::string, midi_search_path, "midi-search-path", "", search_path_expand)
CONFIG_VARIABLE (std::string, auditioner_output_left, "auditioner-output-left", "default")
CONFIG_VARIABLE (std::string, auditioner_output_right, "auditioner-output-right", "default")
CONFIG_VARIABLE (bool, timecode_source_is_synced, "timecode-source-is-synced", true)
CONFIG_VARIABLE (bool, jack_time_master, "jack-time-master", true)
CONFIG_VARIABLE (bool, use_video_sync, "use-video-sync", false)
CONFIG_VARIABLE (float, video_pullup, "video-pullup", 0.0f)
CONFIG_VARIABLE (bool, show_summary, "show-summary", true)
CONFIG_VARIABLE (bool, show_group_tabs, "show-group-tabs", true)
CONFIG_VARIABLE (bool, external_sync, "external-sync", false)
CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK)
CONFIG_VARIABLE (InsertMergePolicy, insert_merge_policy, "insert-merge-policy", InsertMergeRelax)
CONFIG_VARIABLE (framecnt_t, timecode_offset, "timecode-offset", 0)
CONFIG_VARIABLE (bool, timecode_offset_negative, "timecode-offset-negative", true)

View file

@ -54,6 +54,17 @@ public:
*/
const std::string sound_path () const;
/**
* @return the absolute path to the directory in which
* the session stores audio files for Ardour 2.X.
*
* If the session is an older session with an existing
* "sounds" directory then it will return a path to that
* directory otherwise it will return the new location
* of root_path()/interchange/session_name/audiofiles
*/
const std::string sound_path_2X () const;
/**
* @return the absolute path to the directory in which
* the session stores MIDI files, ie
@ -110,6 +121,13 @@ public:
*/
const std::string sources_root() const;
/**
* @return The path to the directory under which source directories
* are created for different source types in Ardour 2.X
* i.e root_path()/interchange/session_name
*/
const std::string sources_root_2X() const;
private:
/**

View file

@ -28,11 +28,18 @@
#include "pbd/signals.h"
#include "timecode/time.h"
#include "ardour/types.h"
#include "midi++/parser.h"
#include "midi++/types.h"
class PIChaser;
#ifdef HAVE_LTC
#include <ltc.h>
#endif
// used for approximate_current_delta():
#define PLUSMINUS(A) ( ((A)<0) ? "\u2012" : (((A)>0) ? "+" : "\u00B1") )
namespace MIDI {
class Port;
@ -167,6 +174,12 @@ class Slave {
* @return - whether ARDOUR should use the slave speed without any adjustments
*/
virtual bool give_slave_full_control_over_transport_speed() const { return false; }
/**
* @return - current time-delta between engine and sync-source
*/
virtual std::string approximate_current_delta() const { return ""; }
};
/// We need this wrapper for testability, it's just too hard to mock up a session class
@ -221,7 +234,21 @@ struct SafeTime {
}
};
class MTC_Slave : public Slave {
class TimecodeSlave : public Slave {
public:
TimecodeSlave () {}
virtual Timecode::TimecodeFormat apparent_timecode_format() const = 0;
/* this is intended to be used by a UI and polled from a timeout. it should
return a string describing the current position of the TC source. it
should NOT do any computation, but should use a cached value
of the TC source position.
*/
virtual std::string approximate_current_position() const = 0;
};
class MTC_Slave : public TimecodeSlave {
public:
MTC_Slave (Session&, MIDI::Port&);
~MTC_Slave ();
@ -238,12 +265,15 @@ class MTC_Slave : public Slave {
framecnt_t seekahead_distance() const;
bool give_slave_full_control_over_transport_speed() const;
Timecode::TimecodeFormat apparent_timecode_format() const;
std::string approximate_current_position() const;
std::string approximate_current_delta() const;
private:
Session& session;
MIDI::Port* port;
PBD::ScopedConnectionList port_connections;
bool can_notify_on_unknown_rate;
PIChaser* pic;
static const int frame_tolerance;
@ -253,18 +283,36 @@ class MTC_Slave : public Slave {
MIDI::byte last_mtc_fps_byte;
framepos_t window_begin;
framepos_t window_end;
framepos_t last_mtc_timestamp;
framepos_t last_mtc_frame;
framepos_t first_mtc_timestamp;
bool did_reset_tc_format;
TimecodeFormat saved_tc_format;
size_t speed_accumulator_size;
double* speed_accumulator;
size_t speed_accumulator_cnt;
bool have_first_speed_accumulator;
double average_speed;
Timecode::TimecodeFormat saved_tc_format;
Glib::Threads::Mutex reset_lock;
uint32_t reset_pending;
bool reset_position;
int transport_direction;
int busy_guard1;
int busy_guard2;
double speedup_due_to_tc_mismatch;
double quarter_frame_duration;
Timecode::TimecodeFormat mtc_timecode;
Timecode::TimecodeFormat a3e_timecode;
Timecode::Time timecode;
bool printed_timecode_warning;
frameoffset_t current_delta;
/* DLL - chase MTC */
double t0; ///< time at the beginning of the MTC quater frame
double t1; ///< calculated end of the MTC quater frame
double e2; ///< second order loop error
double b, c, omega; ///< DLL filter coefficients
/* DLL - sync engine */
int engine_dll_initstate;
double te0; ///< time at the beginning of the engine process
double te1; ///< calculated sync time
double ee2; ///< second order loop error
double be, ce, oe; ///< DLL filter coefficients
void reset (bool with_pos);
void queue_reset (bool with_pos);
@ -276,9 +324,76 @@ class MTC_Slave : public Slave {
void read_current (SafeTime *) const;
void reset_window (framepos_t);
bool outside_window (framepos_t) const;
void process_apparent_speed (double);
void init_mtc_dll(framepos_t, double);
void init_engine_dll (framepos_t, framepos_t);
};
#ifdef HAVE_LTC
class LTC_Slave : public TimecodeSlave {
public:
LTC_Slave (Session&);
~LTC_Slave ();
bool speed_and_position (double&, framepos_t&);
bool locked() const;
bool ok() const;
framecnt_t resolution () const;
bool requires_seekahead () const { return false; }
framecnt_t seekahead_distance () const { return 0; }
bool give_slave_full_control_over_transport_speed() const { return true; }
Timecode::TimecodeFormat apparent_timecode_format() const;
std::string approximate_current_position() const;
std::string approximate_current_delta() const;
private:
void parse_ltc(const jack_nframes_t, const jack_default_audio_sample_t * const, const framecnt_t);
void process_ltc(framepos_t const);
void init_engine_dll (framepos_t, int32_t);
bool detect_discontinuity(LTCFrameExt *, int, bool);
bool detect_ltc_fps(int, bool);
bool equal_ltc_frame_time(LTCFrame *a, LTCFrame *b);
void reset();
void resync_latency();
Session& session;
bool did_reset_tc_format;
Timecode::TimecodeFormat saved_tc_format;
LTCDecoder * decoder;
double frames_per_ltc_frame;
Timecode::Time timecode;
LTCFrameExt prev_frame;
bool fps_detected;
framecnt_t monotonic_cnt;
framecnt_t last_timestamp;
framecnt_t last_ltc_frame;
double ltc_speed;
frameoffset_t current_delta;
int delayedlocked;
int ltc_detect_fps_cnt;
int ltc_detect_fps_max;
bool printed_timecode_warning;
Timecode::TimecodeFormat ltc_timecode;
Timecode::TimecodeFormat a3e_timecode;
PBD::ScopedConnectionList port_connections;
jack_latency_range_t ltc_slave_latency;
/* DLL - chase LTC */
int transport_direction;
int engine_dll_initstate;
double t0; ///< time at the beginning of the MTC quater frame
double t1; ///< calculated end of the MTC quater frame
double e2; ///< second order loop error
double b, c; ///< DLL filter coefficients
};
#endif
class MIDIClock_Slave : public Slave {
public:
MIDIClock_Slave (Session&, MIDI::Port&, int ppqn = 24);
@ -299,6 +414,7 @@ class MIDIClock_Slave : public Slave {
bool give_slave_full_control_over_transport_speed() const { return true; }
void set_bandwidth (double a_bandwith) { bandwidth = a_bandwith; }
std::string approximate_current_delta() const;
protected:
ISlaveSessionProxy* session;
@ -342,6 +458,8 @@ class MIDIClock_Slave : public Slave {
/// DLL filter coefficients
double b, c, omega;
frameoffset_t current_delta;
void reset ();
void start (MIDI::Parser& parser, framepos_t timestamp);
void contineu (MIDI::Parser& parser, framepos_t timestamp);

View file

@ -104,7 +104,7 @@ class Source : public SessionObject
virtual void inc_use_count ();
virtual void dec_use_count ();
int use_count() const { return g_atomic_int_get (&_use_count); }
int use_count() const { return g_atomic_int_get (const_cast<gint*>(&_use_count)); }
bool used() const { return use_count() > 0; }
uint32_t level() const { return _level; }

View file

@ -200,19 +200,6 @@ namespace ARDOUR {
TrackColor
};
enum TimecodeFormat {
timecode_23976,
timecode_24,
timecode_24976,
timecode_25,
timecode_2997,
timecode_2997drop,
timecode_30,
timecode_30drop,
timecode_5994,
timecode_60
};
class AnyTime {
public:
enum Type {
@ -475,7 +462,8 @@ namespace ARDOUR {
enum SyncSource {
JACK,
MTC,
MIDIClock
MIDIClock,
LTC
};
enum ShuttleBehaviour {
@ -589,7 +577,7 @@ std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeChoice& sf);
std::istream& operator>>(std::istream& o, ARDOUR::SyncSource& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleBehaviour& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf);
std::istream& operator>>(std::istream& o, ARDOUR::TimecodeFormat& sf);
std::istream& operator>>(std::istream& o, Timecode::TimecodeFormat& sf);
std::istream& operator>>(std::istream& o, ARDOUR::DenormalModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::WaveformScale& sf);
std::istream& operator>>(std::istream& o, ARDOUR::WaveformShape& sf);
@ -610,7 +598,7 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::CrossfadeChoice& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::SyncSource& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::ShuttleBehaviour& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::ShuttleUnits& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::TimecodeFormat& sf);
std::ostream& operator<<(std::ostream& o, const Timecode::TimecodeFormat& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::DenormalModel& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformScale& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformShape& sf);

View file

@ -39,6 +39,7 @@
class XMLNode;
std::string legalize_for_path (const std::string& str);
std::string legalize_for_path_2X (const std::string& str);
XMLNode* find_named_node (const XMLNode& node, std::string name);
std::string bool_as_string (bool);

View file

@ -75,14 +75,25 @@ public:
private:
void run();
/**
Peek in RB, get size and check if a block of 'size' is available.
Handle the unlikley edge-case, if we're called in between the
responder writing 'size' and 'data'.
@param rb the ringbuffer to check
@return true if the message is complete, false otherwise
*/
bool verify_message_completeness(RingBuffer<uint8_t>* rb);
Workee* _workee;
Glib::Threads::Thread* _thread;
RingBuffer<uint8_t>* _requests;
RingBuffer<uint8_t>* _responses;
uint8_t* _response;
PBD::Semaphore _sem;
bool _exit;
Glib::Threads::Thread* _thread;
};
} // namespace ARDOUR

View file

@ -94,7 +94,7 @@ AudioLibrary::get_tags (string member)
lrdf_statement pattern;
pattern.subject = strdup(Glib::filename_to_uri(member).c_str());
pattern.predicate = (char*)TAG;
pattern.predicate = const_cast<char*>(TAG);
pattern.object = 0;
pattern.object_type = lrdf_literal;
@ -126,8 +126,8 @@ AudioLibrary::search_members_and (vector<string>& members, const vector<string>&
vector<string>::const_iterator i;
for (i = tags.begin(); i != tags.end(); ++i){
pattern = new lrdf_statement;
pattern->subject = (char*)"?";
pattern->predicate = (char*)TAG;
pattern->subject = const_cast<char*>("?");
pattern->predicate = const_cast<char*>(TAG);
pattern->object = strdup((*i).c_str());
pattern->next = old;

View file

@ -176,7 +176,7 @@ AudioTrack::deprecated_use_diskstream_connections ()
}
}
_input->connect_ports_to_bundle (c, this);
_input->connect_ports_to_bundle (c, true, this);
} else if ((prop = node.property ("inputs")) != 0) {
if (_input->set_ports (prop->value())) {

View file

@ -93,6 +93,8 @@ AudioEngine::AudioEngine (string client_name, string session_uuid)
AudioEngine::~AudioEngine ()
{
config_connection.disconnect ();
{
Glib::Threads::Mutex::Lock tm (_process_lock);
session_removed.signal ();
@ -374,31 +376,38 @@ void
AudioEngine::_connect_callback (jack_port_id_t id_a, jack_port_id_t id_b, int conn, void* arg)
{
AudioEngine* ae = static_cast<AudioEngine*> (arg);
ae->connect_callback (id_a, id_b, conn);
}
if (ae->port_remove_in_progress) {
void
AudioEngine::connect_callback (jack_port_id_t id_a, jack_port_id_t id_b, int conn)
{
if (port_remove_in_progress) {
return;
}
GET_PRIVATE_JACK_POINTER (ae->_jack);
GET_PRIVATE_JACK_POINTER (_jack);
jack_port_t* jack_port_a = jack_port_by_id (_priv_jack, id_a);
jack_port_t* jack_port_b = jack_port_by_id (_priv_jack, id_b);
boost::shared_ptr<Port> port_a;
boost::shared_ptr<Port> port_b;
Ports::iterator x;
boost::shared_ptr<Ports> pr = ports.reader ();
boost::shared_ptr<Ports> pr = ae->ports.reader ();
Ports::iterator i = pr->begin ();
while (i != pr->end() && (port_a == 0 || port_b == 0)) {
if (jack_port_a == i->second->jack_port()) {
port_a = i->second;
} else if (jack_port_b == i->second->jack_port()) {
port_b = i->second;
}
++i;
x = pr->find (make_port_name_relative (jack_port_name (jack_port_a)));
if (x != pr->end()) {
port_a = x->second;
}
ae->PortConnectedOrDisconnected (
x = pr->find (make_port_name_relative (jack_port_name (jack_port_b)));
if (x != pr->end()) {
port_b = x->second;
}
PortConnectedOrDisconnected (
port_a, jack_port_name (jack_port_a),
port_b, jack_port_name (jack_port_b),
conn == 0 ? false : true
@ -1610,3 +1619,4 @@ AudioEngine::destroy ()
delete _instance;
_instance = 0;
}

View file

@ -139,6 +139,8 @@ ControlProtocolManager::instantiate (ControlProtocolInfo& cpi)
control_protocols.push_back (cpi.protocol);
ProtocolStatusChange (&cpi);
return cpi.protocol;
}
@ -173,6 +175,9 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
delete cpi.state;
cpi.state = 0;
dlclose (cpi.descriptor->module);
ProtocolStatusChange (&cpi);
return 0;
}
@ -326,30 +331,43 @@ ControlProtocolManager::set_state (const XMLNode& node, int /*version*/)
for (citer = clist.begin(); citer != clist.end(); ++citer) {
if ((*citer)->name() == X_("Protocol")) {
prop = (*citer)->property (X_("active"));
if ((prop = (*citer)->property (X_("active"))) == 0) {
continue;
}
if (prop && string_is_affirmative (prop->value())) {
if ((prop = (*citer)->property (X_("name"))) != 0) {
ControlProtocolInfo* cpi = cpi_by_name (prop->value());
bool active = string_is_affirmative (prop->value());
if ((prop = (*citer)->property (X_("name"))) == 0) {
continue;
}
if (cpi) {
if (cpi->state) {
delete cpi->state;
}
cpi->state = new XMLNode (**citer);
if (_session) {
instantiate (*cpi);
} else {
cpi->requested = true;
}
ControlProtocolInfo* cpi = cpi_by_name (prop->value());
if (cpi) {
if (!(*citer)->children().empty()) {
cpi->state = new XMLNode (*((*citer)->children().front ()));
} else {
cpi->state = 0;
}
if (active) {
if (_session) {
instantiate (*cpi);
} else {
cpi->requested = true;
}
} else {
if (_session) {
teardown (*cpi);
} else {
cpi->requested = false;
}
}
}
}
}
return 0;
}
@ -382,36 +400,6 @@ ControlProtocolManager::get_state ()
return *root;
}
void
ControlProtocolManager::set_protocol_states (const XMLNode& node)
{
XMLNodeList nlist;
XMLNodeConstIterator niter;
XMLProperty* prop;
nlist = node.children();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
XMLNode* child = (*niter);
if ((prop = child->property ("name")) == 0) {
error << _("control protocol XML node has no name property. Ignored.") << endmsg;
continue;
}
ControlProtocolInfo* cpi = cpi_by_name (prop->value());
if (!cpi) {
warning << string_compose (_("control protocol \"%1\" is not known. Ignored"), prop->value()) << endmsg;
continue;
}
/* copy the node so that ownership is clear */
cpi->state = new XMLNode (*child);
}
}
ControlProtocolManager&
ControlProtocolManager::instance ()

View file

@ -36,6 +36,7 @@ uint64_t PBD::DEBUG::ProcessThreads = PBD::new_debug_bit ("processthreads");
uint64_t PBD::DEBUG::Graph = PBD::new_debug_bit ("graph");
uint64_t PBD::DEBUG::Destruction = PBD::new_debug_bit ("destruction");
uint64_t PBD::DEBUG::MTC = PBD::new_debug_bit ("mtc");
uint64_t PBD::DEBUG::LTC = PBD::new_debug_bit ("ltc");
uint64_t PBD::DEBUG::Transport = PBD::new_debug_bit ("transport");
uint64_t PBD::DEBUG::Slave = PBD::new_debug_bit ("slave");
uint64_t PBD::DEBUG::SessionEvents = PBD::new_debug_bit ("sessionevents");

View file

@ -41,6 +41,7 @@ using namespace std;
using namespace PBD;
using namespace ARDOUR;
using namespace MIDI;
using namespace Timecode;
namespace ARDOUR {
@ -306,6 +307,7 @@ setup_enum_writer ()
REGISTER_ENUM (MTC);
REGISTER_ENUM (JACK);
REGISTER_ENUM (MIDIClock);
REGISTER_ENUM (LTC);
REGISTER (_SyncSource);
REGISTER_ENUM (Sprung);
@ -511,6 +513,7 @@ setup_enum_writer ()
REGISTER_CLASS_ENUM (ExportFormatBase, SR_None);
REGISTER_CLASS_ENUM (ExportFormatBase, SR_Session);
REGISTER_CLASS_ENUM (ExportFormatBase, SR_8);
REGISTER_CLASS_ENUM (ExportFormatBase, SR_22_05);
REGISTER_CLASS_ENUM (ExportFormatBase, SR_44_1);
REGISTER_CLASS_ENUM (ExportFormatBase, SR_48);

View file

@ -191,7 +191,7 @@ ExportFormatBase::nearest_sample_rate (framecnt_t sample_rate)
best_match = (rate); \
}
DO_SR_COMPARISON(SR_22_05);
DO_SR_COMPARISON(SR_8);
DO_SR_COMPARISON(SR_22_05);
DO_SR_COMPARISON(SR_44_1);
DO_SR_COMPARISON(SR_48);

View file

@ -205,6 +205,7 @@ void
ExportFormatManager::init_sample_rates ()
{
add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_Session, _("Session rate"))));
add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_8, "8 kHz")));
add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_22_05, "22,05 kHz")));
add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_44_1, "44,1 kHz")));
add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_48, "48 kHz")));

View file

@ -550,6 +550,9 @@ ExportFormatSpecification::description (bool include_name)
}
switch (sample_rate()) {
case SR_8:
components.push_back ("8 kHz");
break;
case SR_22_05:
components.push_back ("22,5 kHz");
break;

View file

@ -186,6 +186,7 @@ ExportFormatLinear::ExportFormatLinear (string name, FormatId format_id) :
set_name (name);
set_format_id (format_id);
add_sample_rate (SR_8);
add_sample_rate (SR_22_05);
add_sample_rate (SR_44_1);
add_sample_rate (SR_48);

View file

@ -480,3 +480,18 @@ ARDOUR::translations_are_disabled ()
/* if file does not exist, we don't translate (bundled ardour only) */
return Glib::file_test (translation_kill_path(), Glib::FILE_TEST_EXISTS) == false;
}
vector<SyncSource>
ARDOUR::get_available_sync_options ()
{
vector<SyncSource> ret;
ret.push_back (JACK);
ret.push_back (MTC);
ret.push_back (MIDIClock);
#ifdef HAVE_LTC
ret.push_back (LTC);
#endif
return ret;
}

View file

@ -45,6 +45,7 @@ InstrumentInfo::~InstrumentInfo ()
{
}
void
InstrumentInfo::set_external_instrument (const string& model, const string& mode)
{
@ -114,10 +115,14 @@ InstrumentInfo::get_patches (uint8_t channel)
return plugin_programs_to_channel_name_set (p);
}
return MidiPatchManager::instance().find_channel_name_set (external_instrument_model,
external_instrument_mode,
channel);
boost::shared_ptr<MIDI::Name::ChannelNameSet> channel_name_set =
MidiPatchManager::instance().find_channel_name_set (external_instrument_model,
external_instrument_mode,
channel);
//std::cerr << "got channel name set with name '" << channel_name_set->name() << std::endl;
return channel_name_set;
}
boost::shared_ptr<MIDI::Name::ChannelNameSet>

View file

@ -912,7 +912,7 @@ IO::make_connections (const XMLNode& node, int version, bool in)
if (prop) {
boost::shared_ptr<Bundle> b = find_possible_bundle (prop->value());
if (b) {
connect_ports_to_bundle (b, this);
connect_ports_to_bundle (b, true, this);
}
}
@ -1241,13 +1241,19 @@ IO::latency () const
}
int
IO::connect_ports_to_bundle (boost::shared_ptr<Bundle> c, void* src)
IO::connect_ports_to_bundle (boost::shared_ptr<Bundle> c, bool exclusive, void* src)
{
BLOCK_PROCESS_CALLBACK ();
{
Glib::Threads::Mutex::Lock lm2 (io_lock);
if (exclusive) {
for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
i->disconnect_all ();
}
}
c->connect (_bundle, _session.engine());
/* If this is a UserBundle, make a note of what we've done */

Some files were not shown because too many files have changed in this diff Show more