Strip trailing whitespace and fix other whitespace errors (e.g. space/tab mixing). Whitespace changes only.
Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red. I don't know the emacs equivalent... git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2003 Paul Davis
|
||||
Copyright (C) 2003 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
|
||||
@@ -220,13 +220,13 @@ About::About ()
|
||||
set_website (X_("http://ardour.org/"));
|
||||
set_website_label (_("visit http://www.ardour.org/"));
|
||||
set_version ((string_compose(_("%1\n(built from revision %2)"),
|
||||
VERSIONSTRING,
|
||||
VERSIONSTRING,
|
||||
svn_revision)));
|
||||
|
||||
|
||||
|
||||
#ifdef WITH_PAYMENT_OPTIONS
|
||||
paypal_button.add (paypal_pixmap);
|
||||
|
||||
|
||||
HBox *payment_box = manage (new HBox);
|
||||
payment_box->pack_start (paypal_button, true, false);
|
||||
|
||||
@@ -247,15 +247,15 @@ About::goto_paypal ()
|
||||
char *argv[4];
|
||||
char *docfile = "foo";
|
||||
int grandchild;
|
||||
|
||||
|
||||
if (fork() == 0) {
|
||||
|
||||
/* child */
|
||||
|
||||
if ((grandchild = fork()) == 0) {
|
||||
|
||||
|
||||
/* grandchild */
|
||||
|
||||
|
||||
argv[0] = "mozilla";
|
||||
argv[1] = "-remote";
|
||||
snprintf (buf, sizeof(buf), "openurl(%s)", docfile);
|
||||
@@ -270,6 +270,6 @@ About::goto_paypal ()
|
||||
waitpid (grandchild, &status, 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2003 Paul Davis
|
||||
Copyright (C) 2003 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
|
||||
@@ -35,6 +35,6 @@ class About : public Gtk::AboutDialog
|
||||
Gtk::Button paypal_button;
|
||||
void goto_paypal ();
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_about_h__ */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2005 Paul Davis
|
||||
Copyright (C) 2005 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
|
||||
@@ -79,7 +79,7 @@ ActionManager::init ()
|
||||
find_file_in_search_path (spath, "ardour.menus", ui_file);
|
||||
|
||||
bool loaded = false;
|
||||
|
||||
|
||||
try {
|
||||
ui_manager->add_ui_from_file (ui_file.to_string());
|
||||
loaded = true;
|
||||
@@ -142,12 +142,12 @@ ActionManager::register_toggle_action (RefPtr<ActionGroup> group, const char * n
|
||||
return act;
|
||||
}
|
||||
|
||||
bool
|
||||
bool
|
||||
ActionManager::lookup_entry (const ustring accel_path, Gtk::AccelKey& key)
|
||||
{
|
||||
GtkAccelKey gkey;
|
||||
bool known = gtk_accel_map_lookup_entry (accel_path.c_str(), &gkey);
|
||||
|
||||
|
||||
if (known) {
|
||||
key = AccelKey (gkey.accel_key, Gdk::ModifierType (gkey.accel_mods));
|
||||
} else {
|
||||
@@ -177,11 +177,11 @@ ActionManager::get_all_actions (vector<string>& groups, vector<string>& names, v
|
||||
GList* acts;
|
||||
|
||||
for (node = list; node; node = g_list_next (node)) {
|
||||
|
||||
|
||||
GtkActionGroup* group = (GtkActionGroup*) node->data;
|
||||
|
||||
|
||||
/* first pass: collect them all */
|
||||
|
||||
|
||||
typedef std::list<Glib::RefPtr<Gtk::Action> > action_list;
|
||||
action_list the_acts;
|
||||
|
||||
@@ -189,9 +189,9 @@ ActionManager::get_all_actions (vector<string>& groups, vector<string>& names, v
|
||||
GtkAction* action = (GtkAction*) acts->data;
|
||||
the_acts.push_back (Glib::wrap (action, true));
|
||||
}
|
||||
|
||||
|
||||
/* now sort by label */
|
||||
|
||||
|
||||
SortActionsByLabel cmp;
|
||||
the_acts.sort (cmp);
|
||||
|
||||
@@ -201,7 +201,7 @@ ActionManager::get_all_actions (vector<string>& groups, vector<string>& names, v
|
||||
|
||||
groups.push_back (gtk_action_group_get_name(group));
|
||||
names.push_back (accel_path.substr (accel_path.find_last_of ('/') + 1));
|
||||
|
||||
|
||||
AccelKey key;
|
||||
lookup_entry (accel_path, key);
|
||||
bindings.push_back (AccelKey (key.get_key(), Gdk::ModifierType (key.get_mod())));
|
||||
@@ -221,11 +221,11 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve
|
||||
GList* acts;
|
||||
|
||||
for (node = list; node; node = g_list_next (node)) {
|
||||
|
||||
|
||||
GtkActionGroup* group = (GtkActionGroup*) node->data;
|
||||
|
||||
|
||||
/* first pass: collect them all */
|
||||
|
||||
|
||||
typedef std::list<Glib::RefPtr<Gtk::Action> > action_list;
|
||||
action_list the_acts;
|
||||
|
||||
@@ -233,9 +233,9 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve
|
||||
GtkAction* action = (GtkAction*) acts->data;
|
||||
the_acts.push_back (Glib::wrap (action, true));
|
||||
}
|
||||
|
||||
|
||||
/* now sort by label */
|
||||
|
||||
|
||||
SortActionsByLabel cmp;
|
||||
the_acts.sort (cmp);
|
||||
|
||||
@@ -246,16 +246,16 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve
|
||||
|
||||
names.push_back (label);
|
||||
paths.push_back (accel_path);
|
||||
|
||||
|
||||
AccelKey key;
|
||||
bool known = lookup_entry (accel_path, key);
|
||||
|
||||
|
||||
if (known) {
|
||||
keys.push_back (ui_manager->get_accel_group()->name (key.get_key(), Gdk::ModifierType (key.get_mod())));
|
||||
} else {
|
||||
keys.push_back (unbound_string);
|
||||
}
|
||||
|
||||
|
||||
bindings.push_back (AccelKey (key.get_key(), Gdk::ModifierType (key.get_mod())));
|
||||
}
|
||||
}
|
||||
@@ -300,11 +300,11 @@ ActionManager::get_action (const char* group_name, const char* action_name)
|
||||
for (node = list; node; node = g_list_next (node)) {
|
||||
|
||||
GtkActionGroup* _ag = (GtkActionGroup*) node->data;
|
||||
|
||||
|
||||
if (strcmp (group_name, gtk_action_group_get_name (_ag)) == 0) {
|
||||
|
||||
|
||||
GtkAction* _act;
|
||||
|
||||
|
||||
if ((_act = gtk_action_group_get_action (_ag, action_name)) != 0) {
|
||||
act = Glib::wrap (_act, true);
|
||||
break;
|
||||
@@ -315,7 +315,7 @@ ActionManager::get_action (const char* group_name, const char* action_name)
|
||||
return act;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
ActionManager::set_sensitive (vector<RefPtr<Action> >& actions, bool state)
|
||||
{
|
||||
for (vector<RefPtr<Action> >::iterator i = actions.begin(); i != actions.end(); ++i) {
|
||||
@@ -368,10 +368,10 @@ ActionManager::toggle_config_state (const char* group, const char* action, bool
|
||||
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
|
||||
if (tact) {
|
||||
bool x = (Config->*get)();
|
||||
|
||||
|
||||
if (x != tact->get_active()) {
|
||||
(Config->*set) (!x);
|
||||
}
|
||||
@@ -411,7 +411,7 @@ ActionManager::map_some_state (const char* group, const char* action, bool (RCCo
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
if (tact) {
|
||||
|
||||
|
||||
bool x = (Config->*get)();
|
||||
|
||||
if (tact->get_active() != x) {
|
||||
@@ -433,7 +433,7 @@ ActionManager::map_some_state (const char* group, const char* action, sigc::slot
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
if (tact) {
|
||||
|
||||
|
||||
bool const x = get ();
|
||||
|
||||
if (tact->get_active() != x) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -76,35 +76,35 @@ class ActionManager
|
||||
|
||||
static void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
|
||||
|
||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
const char * name, const char * label);
|
||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
const char * name, const char * label, sigc::slot<void> sl,
|
||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
const char * name, const char * label, sigc::slot<void> sl,
|
||||
guint key, Gdk::ModifierType mods);
|
||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
const char * name, const char * label, sigc::slot<void> sl);
|
||||
|
||||
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
|
||||
const char * name, const char * label, sigc::slot<void> sl,
|
||||
|
||||
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
|
||||
const char * name, const char * label, sigc::slot<void> sl,
|
||||
guint key, Gdk::ModifierType mods);
|
||||
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
|
||||
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
|
||||
const char * name, const char * label, sigc::slot<void> sl);
|
||||
|
||||
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
const char * name, const char * label, sigc::slot<void> sl,
|
||||
|
||||
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
const char * name, const char * label, sigc::slot<void> sl,
|
||||
guint key, Gdk::ModifierType mods);
|
||||
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
||||
const char * name, const char * label, sigc::slot<void> sl);
|
||||
|
||||
static bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
|
||||
|
||||
static void get_all_actions (std::vector<std::string>& names,
|
||||
std::vector<std::string>& paths,
|
||||
std::vector<std::string>& keys,
|
||||
static void get_all_actions (std::vector<std::string>& names,
|
||||
std::vector<std::string>& paths,
|
||||
std::vector<std::string>& keys,
|
||||
std::vector<Gtk::AccelKey>& bindings);
|
||||
|
||||
static void get_all_actions (std::vector<std::string>& groups,
|
||||
std::vector<std::string>& paths,
|
||||
static void get_all_actions (std::vector<std::string>& groups,
|
||||
std::vector<std::string>& paths,
|
||||
std::vector<Gtk::AccelKey>& bindings);
|
||||
|
||||
static void uncheck_toggleaction (const char * actionname);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -50,7 +50,7 @@ AddMidiCCTrackDialog::AddMidiCCTrackDialog ()
|
||||
|
||||
_chan_spinner.set_name ("AddMidiCCTrackDialogSpinner");
|
||||
_cc_num_spinner.set_name ("AddMidiCCTrackDialogSpinner");
|
||||
|
||||
|
||||
HBox *chan_box = manage (new HBox());
|
||||
Label *chan_label = manage(new Label("Channel: "));
|
||||
chan_box->pack_start(*chan_label, true, true, 4);
|
||||
@@ -65,7 +65,7 @@ AddMidiCCTrackDialog::AddMidiCCTrackDialog ()
|
||||
|
||||
add_button (Stock::CANCEL, RESPONSE_CANCEL);
|
||||
add_button (Stock::ADD, RESPONSE_ACCEPT);
|
||||
|
||||
|
||||
_chan_spinner.show();
|
||||
chan_box->show();
|
||||
chan_label->show();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2003 Paul Davis
|
||||
Copyright (C) 2003 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
|
||||
@@ -71,7 +71,7 @@ AddRouteDialog::AddRouteDialog (Session & s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
set_name ("AddRouteDialog");
|
||||
set_position (Gtk::WIN_POS_MOUSE);
|
||||
set_modal (true);
|
||||
@@ -108,13 +108,13 @@ AddRouteDialog::AddRouteDialog (Session & s)
|
||||
|
||||
HBox *type_hbox = manage (new HBox);
|
||||
type_hbox->set_spacing (6);
|
||||
|
||||
|
||||
/* track/bus choice */
|
||||
|
||||
type_hbox->pack_start (*manage (new Label (_("Add:"))));
|
||||
type_hbox->pack_start (routes_spinner);
|
||||
type_hbox->pack_start (track_bus_combo);
|
||||
|
||||
|
||||
vbox->pack_start (*type_hbox, false, true);
|
||||
|
||||
VBox* options_box = manage (new VBox);
|
||||
@@ -153,7 +153,7 @@ AddRouteDialog::AddRouteDialog (Session & s)
|
||||
l = manage (new Label (_("Group:"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
|
||||
table2->attach (*l, 1, 2, 2, 3, Gtk::FILL, Gtk::EXPAND, 0, 0);
|
||||
table2->attach (route_group_combo, 2, 3, 2, 3, Gtk::FILL, Gtk::EXPAND & Gtk::FILL, 0, 0);
|
||||
|
||||
|
||||
options_box->pack_start (*table2, false, true);
|
||||
vbox->pack_start (*options_box, false, true);
|
||||
|
||||
@@ -197,7 +197,7 @@ ARDOUR::DataType
|
||||
AddRouteDialog::type ()
|
||||
{
|
||||
// FIXME: ew
|
||||
|
||||
|
||||
const string str = channel_combo.get_active_text();
|
||||
if (str == _("MIDI")) {
|
||||
return ARDOUR::DataType::MIDI;
|
||||
@@ -245,7 +245,7 @@ int
|
||||
AddRouteDialog::channels ()
|
||||
{
|
||||
string str = channel_combo.get_active_text();
|
||||
|
||||
|
||||
for (ChannelSetups::iterator i = channel_setups.begin(); i != channel_setups.end(); ++i) {
|
||||
if (str == (*i).name) {
|
||||
return (*i).channels;
|
||||
@@ -274,7 +274,7 @@ AddRouteDialog::on_show ()
|
||||
{
|
||||
refill_channel_setups ();
|
||||
refill_route_groups ();
|
||||
|
||||
|
||||
Dialog::on_show ();
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ void
|
||||
AddRouteDialog::refill_channel_setups ()
|
||||
{
|
||||
ChannelSetup chn;
|
||||
|
||||
|
||||
route_templates.clear ();
|
||||
channel_combo_strings.clear ();
|
||||
channel_setups.clear ();
|
||||
@@ -316,10 +316,10 @@ AddRouteDialog::refill_channel_setups ()
|
||||
chn.template_path = x->path;
|
||||
channel_setups.push_back (chn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* clear template path for the rest */
|
||||
|
||||
|
||||
chn.template_path = "";
|
||||
|
||||
chn.name = _("3 Channel");
|
||||
@@ -386,7 +386,7 @@ AddRouteDialog::refill_route_groups ()
|
||||
route_group_combo.append_text (_("No group"));
|
||||
|
||||
_session.foreach_route_group (mem_fun (*this, &AddRouteDialog::add_route_group));
|
||||
|
||||
|
||||
route_group_combo.set_active (2);
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ AddRouteDialog::group_changed ()
|
||||
{
|
||||
if (route_group_combo.get_active_text () == _("New group...")) {
|
||||
RouteGroup* g = new RouteGroup (_session, "", RouteGroup::Active);
|
||||
|
||||
|
||||
RouteGroupDialog d (g, Gtk::Stock::NEW);
|
||||
int const r = d.do_run ();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -69,7 +69,7 @@ class AddRouteDialog : public ArdourDialog
|
||||
Gtk::ComboBoxText route_group_combo;
|
||||
|
||||
std::vector<ARDOUR::TemplateInfo> route_templates;
|
||||
|
||||
|
||||
void track_type_chosen ();
|
||||
void refill_channel_setups ();
|
||||
void refill_route_groups ();
|
||||
@@ -79,7 +79,7 @@ class AddRouteDialog : public ArdourDialog
|
||||
bool route_separator (const Glib::RefPtr<Gtk::TreeModel> &m, const Gtk::TreeModel::iterator &i);
|
||||
|
||||
void reset_template_option_visibility ();
|
||||
|
||||
|
||||
void on_show ();
|
||||
|
||||
struct ChannelSetup {
|
||||
|
||||
@@ -46,11 +46,11 @@ AnalysisWindow::AnalysisWindow() :
|
||||
source_selection_label (_("Signal source")),
|
||||
source_selection_ranges_rb (_("Selected ranges")),
|
||||
source_selection_regions_rb (_("Selected regions")),
|
||||
|
||||
|
||||
display_model_label (_("Display model")),
|
||||
display_model_composite_separate_rb (_("Composite graphs for each track")),
|
||||
display_model_composite_all_tracks_rb (_("Composite graph of all tracks")),
|
||||
|
||||
|
||||
show_minmax_button (_("Show frequency power range")),
|
||||
show_normalized_button (_("Normalize values")),
|
||||
|
||||
@@ -60,7 +60,7 @@ AnalysisWindow::AnalysisWindow() :
|
||||
set_title(_("FFT analysis window"));
|
||||
|
||||
track_list_ready = false;
|
||||
|
||||
|
||||
// Left side: track list + controls
|
||||
tlmodel = Gtk::ListStore::create(tlcols);
|
||||
track_list.set_model (tlmodel);
|
||||
@@ -73,16 +73,16 @@ AnalysisWindow::AnalysisWindow() :
|
||||
|
||||
Gtk::TreeViewColumn* track_col = track_list.get_column(0);
|
||||
Gtk::CellRendererText* renderer = dynamic_cast<Gtk::CellRendererText*>(track_list.get_column_cell_renderer (0));
|
||||
|
||||
|
||||
track_col->add_attribute(renderer->property_foreground_gdk(), tlcols.color);
|
||||
track_col->set_expand(true);
|
||||
|
||||
|
||||
tlmodel->signal_row_changed().connect (
|
||||
mem_fun(*this, &AnalysisWindow::track_list_row_changed) );
|
||||
|
||||
|
||||
fft_graph.set_analysis_window(this);
|
||||
|
||||
|
||||
vbox.pack_start(track_list);
|
||||
|
||||
|
||||
@@ -94,10 +94,10 @@ AnalysisWindow::AnalysisWindow() :
|
||||
source_selection_regions_rb.set_group(group);
|
||||
|
||||
source_selection_ranges_rb.set_active();
|
||||
|
||||
|
||||
vbox.pack_start (source_selection_ranges_rb, false, false);
|
||||
vbox.pack_start (source_selection_regions_rb, false, false);
|
||||
|
||||
|
||||
// "Selected ranges" radio
|
||||
source_selection_ranges_rb.signal_toggled().connect (
|
||||
bind ( mem_fun(*this, &AnalysisWindow::source_selection_changed), &source_selection_ranges_rb));
|
||||
@@ -106,24 +106,24 @@ AnalysisWindow::AnalysisWindow() :
|
||||
source_selection_regions_rb.signal_toggled().connect (
|
||||
bind ( mem_fun(*this, &AnalysisWindow::source_selection_changed), &source_selection_regions_rb));
|
||||
}
|
||||
|
||||
|
||||
vbox.pack_start(hseparator1, false, false);
|
||||
|
||||
|
||||
// "Display model"
|
||||
vbox.pack_start(display_model_label, false, false);
|
||||
{
|
||||
Gtk::RadioButtonGroup group = display_model_composite_separate_rb.get_group();
|
||||
display_model_composite_all_tracks_rb.set_group (group);
|
||||
|
||||
|
||||
display_model_composite_separate_rb.set_active();
|
||||
|
||||
|
||||
vbox.pack_start (display_model_composite_separate_rb, false, false);
|
||||
vbox.pack_start (display_model_composite_all_tracks_rb, false, false);
|
||||
|
||||
// "Composite graphs for all tracks"
|
||||
display_model_composite_separate_rb.signal_toggled().connect (
|
||||
bind ( mem_fun(*this, &AnalysisWindow::display_model_changed), &display_model_composite_separate_rb));
|
||||
|
||||
|
||||
// "Composite graph of all tracks"
|
||||
display_model_composite_all_tracks_rb.signal_toggled().connect (
|
||||
bind ( mem_fun(*this, &AnalysisWindow::display_model_changed), &display_model_composite_all_tracks_rb));
|
||||
@@ -134,7 +134,7 @@ AnalysisWindow::AnalysisWindow() :
|
||||
refresh_button.set_name("EditorGTKButton");
|
||||
refresh_button.set_label(_("Re-analyze data"));
|
||||
|
||||
refresh_button.signal_clicked().connect ( bind ( mem_fun(*this, &AnalysisWindow::analyze_data), &refresh_button));
|
||||
refresh_button.signal_clicked().connect ( bind ( mem_fun(*this, &AnalysisWindow::analyze_data), &refresh_button));
|
||||
|
||||
vbox.pack_start(refresh_button, false, false, 10);
|
||||
|
||||
@@ -149,18 +149,18 @@ AnalysisWindow::AnalysisWindow() :
|
||||
show_normalized_button.signal_toggled().connect( mem_fun(*this, &AnalysisWindow::show_normalized_changed));
|
||||
vbox.pack_start(show_normalized_button, false, false);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
hbox.pack_start(vbox, Gtk::PACK_SHRINK);
|
||||
|
||||
|
||||
// Analysis window on the right
|
||||
fft_graph.ensure_style();
|
||||
|
||||
hbox.add(fft_graph);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// And last we pack the hbox
|
||||
add(hbox);
|
||||
@@ -197,7 +197,7 @@ AnalysisWindow::set_regionmode()
|
||||
source_selection_regions_rb.set_active(true);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
AnalysisWindow::track_list_row_changed(const Gtk::TreeModel::Path& /*path*/, const Gtk::TreeModel::iterator& /*iter*/)
|
||||
{
|
||||
if (track_list_ready) {
|
||||
@@ -211,7 +211,7 @@ AnalysisWindow::clear_tracklist()
|
||||
{
|
||||
// Empty track list & free old graphs
|
||||
Gtk::TreeNodeChildren children = track_list.get_model()->children();
|
||||
|
||||
|
||||
for (Gtk::TreeIter i = children.begin(); i != children.end(); i++) {
|
||||
Gtk::TreeModel::Row row = *i;
|
||||
|
||||
@@ -221,10 +221,10 @@ AnalysisWindow::clear_tracklist()
|
||||
|
||||
// Make sure it's not drawn
|
||||
row[tlcols.graph] = 0;
|
||||
|
||||
|
||||
delete delete_me;
|
||||
}
|
||||
|
||||
|
||||
tlmodel->clear();
|
||||
}
|
||||
|
||||
@@ -243,17 +243,17 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
|
||||
|
||||
// Empty track list & free old graphs
|
||||
clear_tracklist();
|
||||
|
||||
|
||||
// first we gather the FFTResults of all tracks
|
||||
|
||||
|
||||
Sample *buf = (Sample *) malloc(sizeof(Sample) * fft_graph.windowSize());
|
||||
Sample *mixbuf = (Sample *) malloc(sizeof(Sample) * fft_graph.windowSize());
|
||||
float *gain = (float *) malloc(sizeof(float) * fft_graph.windowSize());
|
||||
|
||||
|
||||
Selection s = PublicEditor::instance().get_selection();
|
||||
TimeSelection ts = s.time;
|
||||
RegionSelection ars = s.regions;
|
||||
|
||||
|
||||
for (TrackSelection::iterator i = s.tracks.begin(); i != s.tracks.end(); ++i) {
|
||||
boost::shared_ptr<AudioPlaylist> pl
|
||||
= boost::dynamic_pointer_cast<AudioPlaylist>((*i)->playlist());
|
||||
@@ -269,11 +269,11 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
|
||||
continue;
|
||||
|
||||
FFTResult *res = fft_graph.prepareResult(rui->color(), rui->route()->name());
|
||||
|
||||
|
||||
// if timeSelection
|
||||
if (source_selection_ranges_rb.get_active()) {
|
||||
// cerr << "Analyzing ranges on track " << *&rui->route().name() << endl;
|
||||
|
||||
|
||||
for (std::list<AudioRange>::iterator j = ts.begin(); j != ts.end(); ++j) {
|
||||
|
||||
int n;
|
||||
@@ -305,15 +305,15 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
|
||||
}
|
||||
} else if (source_selection_regions_rb.get_active()) {
|
||||
// cerr << "Analyzing selected regions on track " << *&rui->route().name() << endl;
|
||||
|
||||
|
||||
TimeAxisView *current_axis = (*i);
|
||||
|
||||
|
||||
for (RegionSelection::iterator j = ars.begin(); j != ars.end(); ++j) {
|
||||
// Check that the region is actually audio (so we can analyze it)
|
||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*j);
|
||||
if (!arv)
|
||||
continue;
|
||||
|
||||
|
||||
// Check that the region really is selected on _this_ track/solo
|
||||
if ( &arv->get_time_axis_view() != current_axis)
|
||||
continue;
|
||||
@@ -357,21 +357,21 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
|
||||
}
|
||||
res->finalize();
|
||||
|
||||
|
||||
|
||||
Gtk::TreeModel::Row newrow = *(tlmodel)->append();
|
||||
newrow[tlcols.trackname] = rui->route()->name();
|
||||
newrow[tlcols.visible] = true;
|
||||
newrow[tlcols.color] = rui->color();
|
||||
newrow[tlcols.graph] = res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
free(buf);
|
||||
free(mixbuf);
|
||||
|
||||
track_list_ready = true;
|
||||
} /* end lock */
|
||||
|
||||
|
||||
fft_graph.redraw();
|
||||
}
|
||||
|
||||
@@ -384,13 +384,13 @@ AnalysisWindow::source_selection_changed (Gtk::RadioButton *button)
|
||||
|
||||
/*
|
||||
cerr << "AnalysisWindow: signal source = ";
|
||||
|
||||
|
||||
if (button == &source_selection_ranges_rb) {
|
||||
cerr << "selected ranges" << endl;
|
||||
|
||||
|
||||
} else if (button == &source_selection_regions_rb) {
|
||||
cerr << "selected regions" << endl;
|
||||
|
||||
|
||||
} else {
|
||||
cerr << "unknown?" << endl;
|
||||
}
|
||||
@@ -406,7 +406,7 @@ AnalysisWindow::display_model_changed (Gtk::RadioButton *button)
|
||||
|
||||
/*
|
||||
cerr << "AnalysisWindow: display model = ";
|
||||
|
||||
|
||||
if (button == &display_model_composite_separate_rb) {
|
||||
cerr << "separate composites of tracks" << endl;
|
||||
} else if (button == &display_model_composite_all_tracks_rb) {
|
||||
@@ -416,5 +416,5 @@ AnalysisWindow::display_model_changed (Gtk::RadioButton *button)
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ ArdourDialog::on_show ()
|
||||
Dialog::on_show ();
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
ArdourDialog::init ()
|
||||
{
|
||||
session = 0;
|
||||
|
||||
@@ -37,7 +37,7 @@ class ArdourDialog : public Gtk::Dialog
|
||||
{
|
||||
public:
|
||||
ArdourDialog (std::string title, bool modal = false, bool use_separator = false);
|
||||
ArdourDialog (Gtk::Window& parent, std::string title, bool modal = false, bool use_separator = false);
|
||||
ArdourDialog (Gtk::Window& parent, std::string title, bool modal = false, bool use_separator = false);
|
||||
~ArdourDialog();
|
||||
|
||||
static int close_all_current_dialogs (int response);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2003 Paul Davis
|
||||
Copyright (C) 2003 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
|
||||
@@ -21,28 +21,28 @@
|
||||
#ifndef __ardour_image_comp_h__
|
||||
#define __ardour_image_comp_h__
|
||||
|
||||
#include <string>
|
||||
#include <string>
|
||||
|
||||
namespace ardourvis
|
||||
{
|
||||
/** Simple version number */
|
||||
const int32_t MSG_VERSION = 1 ;
|
||||
|
||||
|
||||
/** the default port we use */
|
||||
const int32_t DEFAULT_PORT = 30000 ;
|
||||
|
||||
|
||||
/** the maximum buffer size we will use to send receive a message (image data handled differently) */
|
||||
const int32_t MAX_MSG_SIZE = 256 ;
|
||||
|
||||
|
||||
/** the number of characters used for a value describing the characters within a textual data element */
|
||||
const int32_t TEXT_SIZE_CHARS = 3 ;
|
||||
|
||||
|
||||
/** the number of characters we use for time values within a message */
|
||||
const int32_t TIME_VALUE_CHARS = 10 ;
|
||||
|
||||
|
||||
/** the number of charachters we use for other value data, ie image width/height values */
|
||||
const int32_t IMAGE_SIZE_CHARS = 3 ;
|
||||
|
||||
|
||||
/** the number of characters used to for the size of the image data message */
|
||||
const int32_t IMAGE_DATA_MESSAGE_SIZE_CHARS = 32 ;
|
||||
|
||||
@@ -51,116 +51,116 @@ namespace ardourvis
|
||||
// we join the action chars with items to create the message
|
||||
// with the exception of the return values, all messages begin with one
|
||||
// of these message parts
|
||||
|
||||
|
||||
/** Insert an Item */
|
||||
const std::string INSERT_ITEM = "IN" ;
|
||||
|
||||
|
||||
/** Remove an Item */
|
||||
const std::string REMOVE_ITEM = "RM" ;
|
||||
|
||||
|
||||
/** Rename a named item */
|
||||
const std::string RENAME_ITEM = "MV" ;
|
||||
|
||||
|
||||
/** Request some aditional data */
|
||||
const std::string REQUEST_DATA = "RQ" ;
|
||||
|
||||
|
||||
/** Return of a data request */
|
||||
const std::string RETURN_DATA = "RD" ;
|
||||
|
||||
|
||||
/** Update a item */
|
||||
const std::string ITEM_UPDATE = "IU" ;
|
||||
|
||||
|
||||
/** Select an Item */
|
||||
const std::string ITEM_SELECTED = "IS" ;
|
||||
|
||||
|
||||
/** Sesion Action */
|
||||
const std::string SESSION_ACTION = "SA" ;
|
||||
|
||||
|
||||
/** Sesion Action */
|
||||
const std::string SHUTDOWN = "SD" ;
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
// Return values
|
||||
const std::string RETURN_TRUE = "RT1" ;
|
||||
const std::string RETURN_FALSE = "RT0" ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
// Updateable attributes
|
||||
|
||||
|
||||
/** Update the position of a time axis item */
|
||||
const std::string POSITION_CHANGE = "PC" ;
|
||||
|
||||
|
||||
/** Update the duration of a time axis item */
|
||||
const std::string DURATION_CHANGE = "DC" ;
|
||||
|
||||
|
||||
/** Enable the position lock constraint no a time axis item */
|
||||
const std::string POSITION_LOCK_CHANGE = "PL" ;
|
||||
|
||||
|
||||
/** Enable the duration lock constraint no a time axis item */
|
||||
const std::string DURATION_LOCK_CHANGE = "PL" ;
|
||||
|
||||
|
||||
/** Update the Maximum duration of a time axis item (_Upper _Duration) */
|
||||
const std::string MAX_DURATION_CHANGE = "UD" ;
|
||||
|
||||
|
||||
/** Enable the Maximum duration constraint of a time axis item (_Enable _Upper (Duration)) */
|
||||
const std::string MAX_DURATION_ENABLE_CHANGE = "EU" ;
|
||||
|
||||
|
||||
/** Update the Minimum duration of a time axis item (_Lowerr _Duration) */
|
||||
const std::string MIN_DURATION_CHANGE = "LD" ;
|
||||
|
||||
|
||||
/** Enable the Minimum duration constraint of a time axis item (_Enable _Lower (Duration)) */
|
||||
const std::string MIN_DURATION_ENABLE_CHANGE = "EL" ;
|
||||
|
||||
|
||||
/** Refresh the image data of an imageframe item (original image has been altered?) */
|
||||
const std::string IMAGE_REFRESH = "IR" ;
|
||||
|
||||
|
||||
/** the session sample rate has changed */
|
||||
const std::string SAMPLE_RATE_CHANGE = "RC" ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
// Requestable data items
|
||||
|
||||
|
||||
/** RGB data of the iamge */
|
||||
// this is probably a bad choice of string !
|
||||
const std::string IMAGE_RGB_DATA = "ID" ;
|
||||
|
||||
|
||||
/** the (path) name of the Ardour session */
|
||||
const std::string SESSION_NAME = "SN" ;
|
||||
|
||||
|
||||
/** the current sample rate */
|
||||
const std::string SAMPLE_RATE = "SR" ;
|
||||
|
||||
|
||||
/** the (path) name of the image compositor session */
|
||||
const std::string COMPOSITOR_SESSION = "CS" ;
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
// Session Actions - follwed by session path
|
||||
|
||||
|
||||
/** Close a session */
|
||||
const std::string CLOSE_SESSION = "CS" ;
|
||||
|
||||
|
||||
/** Open a session */
|
||||
const std::string OPEN_SESSION = "OS" ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
// Items
|
||||
|
||||
|
||||
const std::string IMAGEFRAME_TIME_AXIS = "IT" ;
|
||||
const std::string MARKER_TIME_AXIS = "MT" ;
|
||||
const std::string IMAGEFRAME_ITEM = "II" ;
|
||||
const std::string MARKER_ITEM = "MI" ;
|
||||
|
||||
|
||||
/** or an ImageFrameTimeAxisGroup */
|
||||
const std::string IMAGEFRAME_GROUP = "IG" ;
|
||||
|
||||
|
||||
} /* namespace ardour_visual */
|
||||
|
||||
#endif /* __ardour_image_comp_socket_h__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -139,7 +139,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||
void set_will_create_new_session_automatically (bool yn) {
|
||||
_will_create_new_session_automatically = yn;
|
||||
}
|
||||
|
||||
|
||||
int get_session_parameters (bool should_be_new = false);
|
||||
void parse_cmdline_path (const Glib::ustring& cmdline_path, Glib::ustring& session_name, Glib::ustring& session_path, bool& existing_session);
|
||||
int load_cmdline_session (const Glib::ustring& session_name, const Glib::ustring& session_path, bool& existing_session);
|
||||
@@ -521,7 +521,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||
void open_session ();
|
||||
void open_recent_session ();
|
||||
void save_template ();
|
||||
|
||||
|
||||
void edit_metadata ();
|
||||
void import_metadata ();
|
||||
|
||||
@@ -616,7 +616,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||
|
||||
Gtk::MenuItem *cleanup_item;
|
||||
|
||||
void display_cleanup_results (ARDOUR::Session::cleanup_report& rep, const gchar* list_title,
|
||||
void display_cleanup_results (ARDOUR::Session::cleanup_report& rep, const gchar* list_title,
|
||||
const std::string& plural_msg, const std::string& singular_msg);
|
||||
void cleanup ();
|
||||
void flush_trash ();
|
||||
@@ -633,10 +633,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||
uint32_t capture;
|
||||
uint32_t playback;
|
||||
|
||||
DiskBufferStat (time_t w, uint32_t c, uint32_t p)
|
||||
DiskBufferStat (time_t w, uint32_t c, uint32_t p)
|
||||
: when (w), capture (c), playback (p) {}
|
||||
};
|
||||
|
||||
|
||||
std::list<DiskBufferStat> disk_buffer_stats;
|
||||
void push_buffer_stats (uint32_t, uint32_t);
|
||||
void write_buffer_stats ();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1999 Paul Davis
|
||||
Copyright (C) 1999 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
|
||||
@@ -55,7 +55,7 @@ using namespace Gtk;
|
||||
using namespace Glib;
|
||||
using namespace sigc;
|
||||
|
||||
int
|
||||
int
|
||||
ARDOUR_UI::setup_windows ()
|
||||
{
|
||||
if (create_editor ()) {
|
||||
@@ -80,18 +80,18 @@ ARDOUR_UI::setup_windows ()
|
||||
|
||||
#ifdef TOP_MENUBAR
|
||||
HBox* status_bar_packer = manage (new HBox);
|
||||
|
||||
|
||||
status_bar_label.set_size_request (300, -1);
|
||||
status_bar_packer->pack_start (status_bar_label, true, true, 6);
|
||||
status_bar_packer->pack_start (error_log_button, false, false);
|
||||
|
||||
|
||||
error_log_button.signal_clicked().connect (mem_fun (*this, &UI::toggle_errors));
|
||||
|
||||
editor->get_status_bar_packer().pack_start (*status_bar_packer, true, true);
|
||||
editor->get_status_bar_packer().pack_start (menu_bar_base, false, false, 6);
|
||||
#else
|
||||
top_packer.pack_start (menu_bar_base, false, false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
top_packer.pack_start (transport_frame, false, false);
|
||||
|
||||
@@ -130,7 +130,7 @@ void
|
||||
ARDOUR_UI::transport_stopped ()
|
||||
{
|
||||
stop_button.set_visual_state (1);
|
||||
|
||||
|
||||
roll_button.set_visual_state (0);
|
||||
play_selection_button.set_visual_state (0);
|
||||
auto_loop_button.set_visual_state (0);
|
||||
@@ -206,15 +206,15 @@ ARDOUR_UI::setup_transport ()
|
||||
transport_frame.set_name ("BaseFrame");
|
||||
transport_frame.add (transport_base);
|
||||
|
||||
transport_tearoff->Detach.connect (bind (mem_fun(*this, &ARDOUR_UI::detach_tearoff), static_cast<Box*>(&top_packer),
|
||||
transport_tearoff->Detach.connect (bind (mem_fun(*this, &ARDOUR_UI::detach_tearoff), static_cast<Box*>(&top_packer),
|
||||
static_cast<Widget*>(&transport_frame)));
|
||||
transport_tearoff->Attach.connect (bind (mem_fun(*this, &ARDOUR_UI::reattach_tearoff), static_cast<Box*> (&top_packer),
|
||||
transport_tearoff->Attach.connect (bind (mem_fun(*this, &ARDOUR_UI::reattach_tearoff), static_cast<Box*> (&top_packer),
|
||||
static_cast<Widget*> (&transport_frame), 1));
|
||||
transport_tearoff->Hidden.connect (bind (mem_fun(*this, &ARDOUR_UI::detach_tearoff), static_cast<Box*>(&top_packer),
|
||||
transport_tearoff->Hidden.connect (bind (mem_fun(*this, &ARDOUR_UI::detach_tearoff), static_cast<Box*>(&top_packer),
|
||||
static_cast<Widget*>(&transport_frame)));
|
||||
transport_tearoff->Visible.connect (bind (mem_fun(*this, &ARDOUR_UI::reattach_tearoff), static_cast<Box*> (&top_packer),
|
||||
transport_tearoff->Visible.connect (bind (mem_fun(*this, &ARDOUR_UI::reattach_tearoff), static_cast<Box*> (&top_packer),
|
||||
static_cast<Widget*> (&transport_frame), 1));
|
||||
|
||||
|
||||
shuttle_box.set_name ("TransportButton");
|
||||
goto_start_button.set_name ("TransportButton");
|
||||
goto_end_button.set_name ("TransportButton");
|
||||
@@ -239,11 +239,11 @@ ARDOUR_UI::setup_transport ()
|
||||
goto_start_button.set_size_request(29, -1);
|
||||
goto_end_button.set_size_request(29, -1);
|
||||
rec_button.set_size_request(29, -1);
|
||||
|
||||
|
||||
Widget* w;
|
||||
|
||||
stop_button.set_visual_state (1);
|
||||
|
||||
|
||||
w = manage (new Image (get_icon (X_("transport_start"))));
|
||||
w->show();
|
||||
goto_start_button.add (*w);
|
||||
@@ -303,7 +303,7 @@ ARDOUR_UI::setup_transport ()
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (shuttle_box, _("Shuttle speed control"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (shuttle_units_button, _("Select semitones or %%-age for speed display"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (speed_display_box, _("Current transport speed"));
|
||||
|
||||
|
||||
shuttle_box.set_flags (CAN_FOCUS);
|
||||
shuttle_box.add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
|
||||
shuttle_box.set_size_request (100, 15);
|
||||
@@ -376,7 +376,7 @@ ARDOUR_UI::setup_transport ()
|
||||
|
||||
shuttle_units_button.set_name (X_("ShuttleButton"));
|
||||
shuttle_units_button.signal_clicked().connect (mem_fun(*this, &ARDOUR_UI::shuttle_unit_clicked));
|
||||
|
||||
|
||||
shuttle_style_button.set_name (X_("ShuttleStyleButton"));
|
||||
|
||||
vector<string> shuttle_strings;
|
||||
@@ -399,7 +399,7 @@ ARDOUR_UI::setup_transport ()
|
||||
shbox->pack_start (*sdframe, false, false);
|
||||
shbox->pack_start (shuttle_units_button, true, true);
|
||||
shbox->pack_start (shuttle_style_button, false, false);
|
||||
|
||||
|
||||
svbox->pack_start (*sframe, false, false);
|
||||
svbox->pack_start (*shbox, false, false);
|
||||
|
||||
@@ -429,7 +429,7 @@ ARDOUR_UI::setup_transport ()
|
||||
transport_tearoff_hbox.pack_start (*clock_box, false, false, 0);
|
||||
|
||||
HBox* toggle_box = manage(new HBox);
|
||||
|
||||
|
||||
VBox* punch_box = manage (new VBox);
|
||||
punch_box->pack_start (punch_in_button, false, false);
|
||||
punch_box->pack_start (punch_out_button, false, false);
|
||||
@@ -439,12 +439,12 @@ ARDOUR_UI::setup_transport ()
|
||||
auto_box->pack_start (auto_play_button, false, false);
|
||||
auto_box->pack_start (auto_return_button, false, false);
|
||||
toggle_box->pack_start (*auto_box, false, false);
|
||||
|
||||
|
||||
VBox* io_box = manage (new VBox);
|
||||
io_box->pack_start (auto_input_button, false, false);
|
||||
io_box->pack_start (click_button, false, false);
|
||||
toggle_box->pack_start (*io_box, false, false);
|
||||
|
||||
|
||||
/* desensitize */
|
||||
|
||||
set_transport_sensitivity (false);
|
||||
@@ -457,7 +457,7 @@ ARDOUR_UI::setup_transport ()
|
||||
|
||||
transport_tearoff_hbox.pack_start (*toggle_box, false, false, 4);
|
||||
transport_tearoff_hbox.pack_start (alert_box, false, false);
|
||||
|
||||
|
||||
if (Profile->get_sae()) {
|
||||
Image* img = manage (new Image ((::get_icon (X_("sae")))));
|
||||
transport_tearoff_hbox.pack_end (*img, false, false, 6);
|
||||
@@ -531,7 +531,7 @@ ARDOUR_UI::solo_blink (bool onoff)
|
||||
if (session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (session->soloing()) {
|
||||
if (onoff) {
|
||||
solo_alert_button.set_state (STATE_ACTIVE);
|
||||
@@ -550,7 +550,7 @@ ARDOUR_UI::audition_blink (bool onoff)
|
||||
if (session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (session->is_auditioning()) {
|
||||
if (onoff) {
|
||||
auditioning_alert_button.set_state (STATE_ACTIVE);
|
||||
@@ -578,27 +578,27 @@ ARDOUR_UI::build_shuttle_context_menu ()
|
||||
|
||||
speed_items.push_back (RadioMenuElem (group, "8", bind (mem_fun (*this, &ARDOUR_UI::set_shuttle_max_speed), 8.0f)));
|
||||
if (shuttle_max_speed == 8.0) {
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
}
|
||||
speed_items.push_back (RadioMenuElem (group, "6", bind (mem_fun (*this, &ARDOUR_UI::set_shuttle_max_speed), 6.0f)));
|
||||
if (shuttle_max_speed == 6.0) {
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
}
|
||||
speed_items.push_back (RadioMenuElem (group, "4", bind (mem_fun (*this, &ARDOUR_UI::set_shuttle_max_speed), 4.0f)));
|
||||
if (shuttle_max_speed == 4.0) {
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
}
|
||||
speed_items.push_back (RadioMenuElem (group, "3", bind (mem_fun (*this, &ARDOUR_UI::set_shuttle_max_speed), 3.0f)));
|
||||
if (shuttle_max_speed == 3.0) {
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
}
|
||||
speed_items.push_back (RadioMenuElem (group, "2", bind (mem_fun (*this, &ARDOUR_UI::set_shuttle_max_speed), 2.0f)));
|
||||
if (shuttle_max_speed == 2.0) {
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
}
|
||||
speed_items.push_back (RadioMenuElem (group, "1.5", bind (mem_fun (*this, &ARDOUR_UI::set_shuttle_max_speed), 1.5f)));
|
||||
if (shuttle_max_speed == 1.5) {
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
||||
}
|
||||
|
||||
items.push_back (MenuElem (_("Maximum speed"), *speed_menu));
|
||||
@@ -658,7 +658,7 @@ ARDOUR_UI::shuttle_box_button_release (GdkEventButton* ev)
|
||||
if (!session) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
switch (ev->button) {
|
||||
case 1:
|
||||
mouse_shuttle (ev->x, true);
|
||||
@@ -666,7 +666,7 @@ ARDOUR_UI::shuttle_box_button_release (GdkEventButton* ev)
|
||||
shuttle_box.remove_modal_grab ();
|
||||
if (Config->get_shuttle_behaviour() == Sprung) {
|
||||
if (session->config.get_auto_play() || roll_button.get_visual_state()) {
|
||||
shuttle_fract = SHUTTLE_FRACT_SPEED1;
|
||||
shuttle_fract = SHUTTLE_FRACT_SPEED1;
|
||||
session->request_transport_speed (1.0);
|
||||
stop_button.set_visual_state (0);
|
||||
roll_button.set_visual_state (1);
|
||||
@@ -707,9 +707,9 @@ ARDOUR_UI::shuttle_box_scroll (GdkEventScroll* ev)
|
||||
if (!session) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
switch (ev->direction) {
|
||||
|
||||
|
||||
case GDK_SCROLL_UP:
|
||||
shuttle_fract += 0.005;
|
||||
break;
|
||||
@@ -764,7 +764,7 @@ void
|
||||
ARDOUR_UI::use_shuttle_fract (bool force)
|
||||
{
|
||||
microseconds_t now = get_microseconds();
|
||||
|
||||
|
||||
/* do not attempt to submit a motion-driven transport speed request
|
||||
more than once per process cycle.
|
||||
*/
|
||||
@@ -772,7 +772,7 @@ ARDOUR_UI::use_shuttle_fract (bool force)
|
||||
if (!force && (last_shuttle_request - now) < (microseconds_t) engine->usecs_per_cycle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
last_shuttle_request = now;
|
||||
|
||||
if (Config->get_shuttle_units() == Semitones) {
|
||||
@@ -790,7 +790,7 @@ ARDOUR_UI::use_shuttle_fract (bool force)
|
||||
|
||||
bool neg;
|
||||
double fract;
|
||||
|
||||
|
||||
neg = (shuttle_fract < 0.0);
|
||||
|
||||
fract = 1 - sqrt (1 - (shuttle_fract * shuttle_fract)); // Formula A1
|
||||
@@ -886,8 +886,8 @@ ARDOUR_UI::update_speed_display ()
|
||||
|
||||
last_speed_displayed = x;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::set_transport_sensitivity (bool yn)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000 Paul Davis
|
||||
Copyright (C) 2000 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
|
||||
@@ -77,7 +77,7 @@ ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
|
||||
mixer->connect_to_session (s);
|
||||
|
||||
/* its safe to do this now */
|
||||
|
||||
|
||||
BootMessage (_("Reload Session History"));
|
||||
s->restore_history ("");
|
||||
}
|
||||
@@ -93,7 +93,7 @@ void
|
||||
ARDOUR_UI::goto_editor_window ()
|
||||
{
|
||||
if (splash && splash->is_visible()) {
|
||||
// in 2 seconds, hide the splash screen
|
||||
// in 2 seconds, hide the splash screen
|
||||
Glib::signal_timeout().connect (bind (sigc::ptr_fun (_hide_splash), this), 2000);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000 Paul Davis
|
||||
Copyright (C) 2000 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
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/* This file contains any ARDOUR_UI methods that require knowledge of
|
||||
the various dialog boxes, and exists so that no compilation dependency
|
||||
the various dialog boxes, and exists so that no compilation dependency
|
||||
exists between the main ARDOUR_UI modules and their respective classes.
|
||||
This is to cut down on the compile times. It also helps with my sanity.
|
||||
*/
|
||||
@@ -58,7 +58,7 @@ ARDOUR_UI::connect_to_session (Session *s)
|
||||
|
||||
ActionManager::set_sensitive (ActionManager::session_sensitive_actions, true);
|
||||
ActionManager::set_sensitive (ActionManager::write_sensitive_actions, session->writable());
|
||||
|
||||
|
||||
if (session->locations()->num_range_markers()) {
|
||||
ActionManager::set_sensitive (ActionManager::range_sensitive_actions, true);
|
||||
} else {
|
||||
@@ -92,7 +92,7 @@ ARDOUR_UI::connect_to_session (Session *s)
|
||||
|
||||
rec_button.set_sensitive (true);
|
||||
shuttle_box.set_sensitive (true);
|
||||
|
||||
|
||||
if (location_ui) {
|
||||
location_ui->set_session(s);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ ARDOUR_UI::connect_to_session (Session *s)
|
||||
|
||||
/* Clocks are on by default after we are connected to a session, so show that here.
|
||||
*/
|
||||
|
||||
|
||||
connect_dependents_to_session (s);
|
||||
|
||||
/* listen to clock mode changes. don't do this earlier because otherwise as the clocks
|
||||
@@ -164,7 +164,7 @@ ARDOUR_UI::unload_session (bool hide_stuff)
|
||||
case -1:
|
||||
// cancel
|
||||
return 1;
|
||||
|
||||
|
||||
case 1:
|
||||
session->save_state ("");
|
||||
break;
|
||||
@@ -183,7 +183,7 @@ ARDOUR_UI::unload_session (bool hide_stuff)
|
||||
point_zero_one_second_connection.disconnect();
|
||||
|
||||
ActionManager::set_sensitive (ActionManager::session_sensitive_actions, false);
|
||||
|
||||
|
||||
rec_button.set_sensitive (false);
|
||||
shuttle_box.set_sensitive (false);
|
||||
|
||||
@@ -214,13 +214,13 @@ ARDOUR_UI::toggle_big_clock_window ()
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleBigClock"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
|
||||
if (tact->get_active()) {
|
||||
big_clock_window->show_all ();
|
||||
big_clock_window->present ();
|
||||
} else {
|
||||
big_clock_window->hide ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,18 +231,18 @@ ARDOUR_UI::toggle_rc_options_window ()
|
||||
rc_option_editor = new RCOptionEditor;
|
||||
rc_option_editor->signal_unmap().connect(sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleRCOptionsEditor")));
|
||||
rc_option_editor->set_session (session);
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleRCOptionsEditor"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
|
||||
if (tact->get_active()) {
|
||||
rc_option_editor->show_all ();
|
||||
rc_option_editor->present ();
|
||||
} else {
|
||||
rc_option_editor->hide ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,18 +252,18 @@ ARDOUR_UI::toggle_session_options_window ()
|
||||
if (session_option_editor == 0) {
|
||||
session_option_editor = new SessionOptionEditor (session);
|
||||
session_option_editor->signal_unmap().connect(sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleSessionOptionsEditor")));
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleSessionOptionsEditor"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
|
||||
|
||||
if (tact->get_active()) {
|
||||
session_option_editor->show_all ();
|
||||
session_option_editor->present ();
|
||||
} else {
|
||||
session_option_editor->hide ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,13 +288,13 @@ ARDOUR_UI::toggle_location_window ()
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleLocations"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
|
||||
if (tact->get_active()) {
|
||||
location_ui->show_all ();
|
||||
location_ui->present ();
|
||||
} else {
|
||||
location_ui->hide ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,19 +303,19 @@ ARDOUR_UI::toggle_key_editor ()
|
||||
{
|
||||
if (key_editor == 0) {
|
||||
key_editor = new KeyEditor;
|
||||
key_editor->signal_unmap().connect (sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleKeyEditor")));
|
||||
key_editor->signal_unmap().connect (sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleKeyEditor")));
|
||||
}
|
||||
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleKeyEditor"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
|
||||
if (tact->get_active()) {
|
||||
key_editor->show_all ();
|
||||
key_editor->present ();
|
||||
} else {
|
||||
key_editor->hide ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,13 +325,13 @@ ARDOUR_UI::toggle_theme_manager ()
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleThemeManager"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
|
||||
if (tact->get_active()) {
|
||||
theme_manager->show_all ();
|
||||
theme_manager->present ();
|
||||
} else {
|
||||
theme_manager->hide ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,17 +348,17 @@ void
|
||||
ARDOUR_UI::toggle_bundle_manager ()
|
||||
{
|
||||
create_bundle_manager ();
|
||||
|
||||
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleBundleManager"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
|
||||
|
||||
if (tact->get_active()) {
|
||||
bundle_manager->show_all ();
|
||||
bundle_manager->present ();
|
||||
} else {
|
||||
bundle_manager->hide ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,13 +383,13 @@ ARDOUR_UI::toggle_route_params_window ()
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleInspector"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
|
||||
if (tact->get_active()) {
|
||||
route_params->show_all ();
|
||||
route_params->present ();
|
||||
} else {
|
||||
route_params->hide ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,14 +410,14 @@ ARDOUR_UI::main_window_state_event_handler (GdkEventWindowState* ev, bool window
|
||||
{
|
||||
if (window_was_editor) {
|
||||
|
||||
if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
|
||||
if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
|
||||
(ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
|
||||
float_big_clock (editor);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
|
||||
if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
|
||||
(ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
|
||||
float_big_clock (mixer);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000 Paul Davis
|
||||
Copyright (C) 2000 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
|
||||
@@ -35,7 +35,7 @@ ARDOUR_UI::create_mixer ()
|
||||
{
|
||||
try {
|
||||
mixer = new Mixer_UI ();
|
||||
}
|
||||
}
|
||||
|
||||
catch (failed_constructor& err) {
|
||||
return -1;
|
||||
|
||||
@@ -33,12 +33,12 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
|
||||
public:
|
||||
AUPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>);
|
||||
~AUPluginUI ();
|
||||
|
||||
|
||||
gint get_preferred_height () { return prefheight; }
|
||||
gint get_preferred_width () { return prefwidth; }
|
||||
bool start_updating(GdkEventAny*);
|
||||
bool stop_updating(GdkEventAny*);
|
||||
|
||||
|
||||
void activate ();
|
||||
void deactivate ();
|
||||
|
||||
@@ -77,7 +77,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
|
||||
NSWindow* cocoa_parent;
|
||||
ComponentDescription carbon_descriptor;
|
||||
AudioUnitCarbonView editView;
|
||||
WindowRef carbon_window;
|
||||
WindowRef carbon_window;
|
||||
EventHandlerRef carbon_event_handler;
|
||||
bool _activating_from_app;
|
||||
NSView* packView;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1999 Paul Davis
|
||||
Copyright (C) 1999 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
|
||||
@@ -63,7 +63,7 @@ const uint32_t AudioClock::field_length[(int) AudioClock::AudioFrames+1] = {
|
||||
10 /* Audio Frame */
|
||||
};
|
||||
|
||||
AudioClock::AudioClock (std::string clock_name, bool transient, std::string widget_name, bool allow_edit, bool duration, bool with_info)
|
||||
AudioClock::AudioClock (std::string clock_name, bool transient, std::string widget_name, bool allow_edit, bool duration, bool with_info)
|
||||
: _name (clock_name),
|
||||
is_transient (transient),
|
||||
is_duration (duration),
|
||||
@@ -93,7 +93,7 @@ AudioClock::AudioClock (std::string clock_name, bool transient, std::string widg
|
||||
smpte_lower_info_label = manage (new Label);
|
||||
bbt_upper_info_label = manage (new Label);
|
||||
bbt_lower_info_label = manage (new Label);
|
||||
|
||||
|
||||
frames_upper_info_label->set_name ("AudioClockFramesUpperInfo");
|
||||
frames_lower_info_label->set_name ("AudioClockFramesLowerInfo");
|
||||
smpte_upper_info_label->set_name ("AudioClockSMPTEUpperInfo");
|
||||
@@ -113,7 +113,7 @@ AudioClock::AudioClock (std::string clock_name, bool transient, std::string widg
|
||||
smpte_info_box.pack_start (*smpte_lower_info_label, true, true);
|
||||
bbt_info_box.pack_start (*bbt_upper_info_label, true, true);
|
||||
bbt_info_box.pack_start (*bbt_lower_info_label, true, true);
|
||||
|
||||
|
||||
} else {
|
||||
frames_upper_info_label = 0;
|
||||
frames_lower_info_label = 0;
|
||||
@@ -121,18 +121,18 @@ AudioClock::AudioClock (std::string clock_name, bool transient, std::string widg
|
||||
smpte_lower_info_label = 0;
|
||||
bbt_upper_info_label = 0;
|
||||
bbt_lower_info_label = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
audio_frames_ebox.add (audio_frames_label);
|
||||
|
||||
|
||||
frames_packer.set_homogeneous (false);
|
||||
frames_packer.set_border_width (2);
|
||||
frames_packer.pack_start (audio_frames_ebox, false, false);
|
||||
|
||||
|
||||
if (with_info) {
|
||||
frames_packer.pack_start (frames_info_box, false, false, 5);
|
||||
}
|
||||
|
||||
|
||||
frames_packer_hbox.pack_start (frames_packer, true, false);
|
||||
|
||||
hours_ebox.add (hours_label);
|
||||
@@ -254,7 +254,7 @@ AudioClock::set_widget_name (string name)
|
||||
ms_hours_ebox.set_name (name);
|
||||
ms_minutes_ebox.set_name (name);
|
||||
ms_seconds_ebox.set_name (name);
|
||||
|
||||
|
||||
colon1.set_name (name);
|
||||
colon2.set_name (name);
|
||||
colon3.set_name (name);
|
||||
@@ -418,7 +418,7 @@ AudioClock::set (nframes_t when, bool force, nframes_t offset, char which)
|
||||
if ((!force && !is_visible()) || session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (when == last_when && !offset && !force) {
|
||||
return;
|
||||
}
|
||||
@@ -495,22 +495,22 @@ AudioClock::set_frames (nframes_t when, bool /*force*/)
|
||||
char buf[32];
|
||||
snprintf (buf, sizeof (buf), "%u", when);
|
||||
audio_frames_label.set_text (buf);
|
||||
|
||||
|
||||
if (frames_upper_info_label) {
|
||||
nframes_t rate = session->frame_rate();
|
||||
|
||||
|
||||
if (fmod (rate, 1000.0) == 0.000) {
|
||||
sprintf (buf, "%uK", rate/1000);
|
||||
} else {
|
||||
sprintf (buf, "%.3fK", rate/1000.0f);
|
||||
}
|
||||
|
||||
|
||||
if (frames_upper_info_label->get_text() != buf) {
|
||||
frames_upper_info_label->set_text (buf);
|
||||
}
|
||||
|
||||
|
||||
float vid_pullup = session->config.get_video_pullup();
|
||||
|
||||
|
||||
if (vid_pullup == 0.0) {
|
||||
if (frames_lower_info_label->get_text () != _("none")) {
|
||||
frames_lower_info_label->set_text(_("none"));
|
||||
@@ -522,7 +522,7 @@ AudioClock::set_frames (nframes_t when, bool /*force*/)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioClock::set_minsec (nframes_t when, bool force)
|
||||
@@ -532,7 +532,7 @@ AudioClock::set_minsec (nframes_t when, bool force)
|
||||
int hrs;
|
||||
int mins;
|
||||
float secs;
|
||||
|
||||
|
||||
left = when;
|
||||
hrs = (int) floor (left / (session->frame_rate() * 60.0f * 60.0f));
|
||||
left -= (nframes_t) floor (hrs * session->frame_rate() * 60.0f * 60.0f);
|
||||
@@ -564,7 +564,7 @@ AudioClock::set_smpte (nframes_t when, bool force)
|
||||
{
|
||||
char buf[32];
|
||||
SMPTE::Time smpte;
|
||||
|
||||
|
||||
if (is_duration) {
|
||||
session->smpte_duration (when, smpte);
|
||||
} else {
|
||||
@@ -599,20 +599,20 @@ AudioClock::set_smpte (nframes_t when, bool force)
|
||||
frames_label.set_text (buf);
|
||||
last_frames = smpte.frames;
|
||||
}
|
||||
|
||||
|
||||
if (smpte_upper_info_label) {
|
||||
double smpte_frames = session->smpte_frames_per_second();
|
||||
|
||||
|
||||
if ( fmod(smpte_frames, 1.0) == 0.0) {
|
||||
sprintf (buf, "%u", int (smpte_frames));
|
||||
sprintf (buf, "%u", int (smpte_frames));
|
||||
} else {
|
||||
sprintf (buf, "%.2f", smpte_frames);
|
||||
}
|
||||
|
||||
|
||||
if (smpte_upper_info_label->get_text() != buf) {
|
||||
smpte_upper_info_label->set_text (buf);
|
||||
}
|
||||
|
||||
|
||||
if ((fabs(smpte_frames - 29.97) < 0.0001) || smpte_frames == 30) {
|
||||
if (session->smpte_drop_frames()) {
|
||||
sprintf (buf, "DF");
|
||||
@@ -623,7 +623,7 @@ AudioClock::set_smpte (nframes_t when, bool force)
|
||||
// there is no drop frame alternative
|
||||
buf[0] = '\0';
|
||||
}
|
||||
|
||||
|
||||
if (smpte_lower_info_label->get_text() != buf) {
|
||||
smpte_lower_info_label->set_text (buf);
|
||||
}
|
||||
@@ -641,7 +641,7 @@ AudioClock::set_bbt (nframes_t when, bool force)
|
||||
if (when == 0) {
|
||||
bbt.bars = 0;
|
||||
bbt.beats = 0;
|
||||
bbt.ticks = 0;
|
||||
bbt.ticks = 0;
|
||||
} else {
|
||||
session->tempo_map().bbt_time (when, bbt);
|
||||
bbt.bars--;
|
||||
@@ -663,7 +663,7 @@ AudioClock::set_bbt (nframes_t when, bool force)
|
||||
if (force || ticks_label.get_text () != buf) {
|
||||
ticks_label.set_text (buf);
|
||||
}
|
||||
|
||||
|
||||
if (bbt_upper_info_label) {
|
||||
nframes64_t pos;
|
||||
|
||||
@@ -696,7 +696,7 @@ AudioClock::set_session (Session *s)
|
||||
XMLProperty* prop;
|
||||
XMLNode* node = session->extra_xml (X_("ClockModes"));
|
||||
AudioClock::Mode amode;
|
||||
|
||||
|
||||
if (node) {
|
||||
if ((prop = node->property (_name)) != 0) {
|
||||
amode = AudioClock::Mode (string_2_enum (prop->value(), amode));
|
||||
@@ -889,11 +889,11 @@ AudioClock::field_key_release_event (GdkEventKey *ev, Field field)
|
||||
if (key_entry_state == field_length[field]) {
|
||||
move_on = true;
|
||||
}
|
||||
|
||||
|
||||
if (move_on) {
|
||||
|
||||
if (key_entry_state) {
|
||||
|
||||
|
||||
switch (field) {
|
||||
case SMPTE_Hours:
|
||||
case SMPTE_Minutes:
|
||||
@@ -917,17 +917,17 @@ AudioClock::field_key_release_event (GdkEventKey *ev, Field field)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
ValueChanged(); /* EMIT_SIGNAL */
|
||||
}
|
||||
|
||||
|
||||
/* move on to the next field.
|
||||
*/
|
||||
|
||||
|
||||
switch (field) {
|
||||
|
||||
|
||||
/* SMPTE */
|
||||
|
||||
|
||||
case SMPTE_Hours:
|
||||
minutes_ebox.grab_focus ();
|
||||
break;
|
||||
@@ -1130,7 +1130,7 @@ AudioClock::field_button_release_event (GdkEventButton *ev, Field field)
|
||||
}
|
||||
ops_menu->popup (1, ev->time);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
switch (ev->button) {
|
||||
case 1:
|
||||
@@ -1151,7 +1151,7 @@ AudioClock::field_button_release_event (GdkEventButton *ev, Field field)
|
||||
case AudioFrames:
|
||||
audio_frames_ebox.grab_focus();
|
||||
break;
|
||||
|
||||
|
||||
case MS_Hours:
|
||||
ms_hours_ebox.grab_focus();
|
||||
break;
|
||||
@@ -1161,7 +1161,7 @@ AudioClock::field_button_release_event (GdkEventButton *ev, Field field)
|
||||
case MS_Seconds:
|
||||
ms_seconds_ebox.grab_focus();
|
||||
break;
|
||||
|
||||
|
||||
case Bars:
|
||||
bars_ebox.grab_focus ();
|
||||
break;
|
||||
@@ -1173,7 +1173,7 @@ AudioClock::field_button_release_event (GdkEventButton *ev, Field field)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1196,10 +1196,10 @@ AudioClock::field_button_press_event (GdkEventButton *ev, Field /*field*/)
|
||||
set (frames, true);
|
||||
ValueChanged (); /* EMIT_SIGNAL */
|
||||
}
|
||||
|
||||
|
||||
/* make absolutely sure that the pointer is grabbed */
|
||||
gdk_pointer_grab(ev->window,false ,
|
||||
GdkEventMask( Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK),
|
||||
GdkEventMask( Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK),
|
||||
NULL,NULL,ev->time);
|
||||
dragging = true;
|
||||
drag_accum = 0;
|
||||
@@ -1223,7 +1223,7 @@ AudioClock::field_button_press_event (GdkEventButton *ev, Field /*field*/)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1255,13 +1255,13 @@ AudioClock::field_button_scroll_event (GdkEventScroll *ev, Field field)
|
||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
||||
frames *= 10;
|
||||
}
|
||||
|
||||
|
||||
if ((double)current_time() - (double)frames < 0.0) {
|
||||
set (0, true);
|
||||
} else {
|
||||
set (current_time() - frames, true);
|
||||
}
|
||||
|
||||
|
||||
ValueChanged (); /* EMIT_SIGNAL */
|
||||
}
|
||||
break;
|
||||
@@ -1270,7 +1270,7 @@ AudioClock::field_button_scroll_event (GdkEventScroll *ev, Field field)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1280,7 +1280,7 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
|
||||
if (session == 0 || !dragging) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
float pixel_frame_scale_factor = 0.2f;
|
||||
|
||||
/*
|
||||
@@ -1289,7 +1289,7 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
|
||||
}
|
||||
|
||||
|
||||
if (Keyboard::modifier_state_contains (ev->state,
|
||||
if (Keyboard::modifier_state_contains (ev->state,
|
||||
Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) {
|
||||
|
||||
pixel_frame_scale_factor = 0.025f;
|
||||
@@ -1309,19 +1309,19 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
|
||||
dir = (drag_accum < 0 ? 1:-1);
|
||||
pos = current_time();
|
||||
frames = get_frames (field,pos,dir);
|
||||
|
||||
|
||||
if (frames != 0 && frames * drag_accum < current_time()) {
|
||||
|
||||
|
||||
set ((nframes_t) floor (pos - drag_accum * frames), false); // minus because up is negative in computer-land
|
||||
|
||||
|
||||
} else {
|
||||
set (0 , false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
drag_accum= 0;
|
||||
ValueChanged(); /* EMIT_SIGNAL */
|
||||
|
||||
ValueChanged(); /* EMIT_SIGNAL */
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1448,11 +1448,11 @@ AudioClock::smpte_sanitize_display()
|
||||
if (atoi(minutes_label.get_text()) > 59) {
|
||||
minutes_label.set_text("59");
|
||||
}
|
||||
|
||||
|
||||
if (atoi(seconds_label.get_text()) > 59) {
|
||||
seconds_label.set_text("59");
|
||||
}
|
||||
|
||||
|
||||
switch ((long)rint(session->smpte_frames_per_second())) {
|
||||
case 24:
|
||||
if (atoi(frames_label.get_text()) > 23) {
|
||||
@@ -1472,7 +1472,7 @@ AudioClock::smpte_sanitize_display()
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (session->smpte_drop_frames()) {
|
||||
if ((atoi(minutes_label.get_text()) % 10) && (atoi(seconds_label.get_text()) == 0) && (atoi(frames_label.get_text()) < 2)) {
|
||||
frames_label.set_text("02");
|
||||
@@ -1486,10 +1486,10 @@ AudioClock::smpte_frame_from_display () const
|
||||
if (session == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
SMPTE::Time smpte;
|
||||
nframes_t sample;
|
||||
|
||||
|
||||
smpte.hours = atoi (hours_label.get_text());
|
||||
smpte.minutes = atoi (minutes_label.get_text());
|
||||
smpte.seconds = atoi (seconds_label.get_text());
|
||||
@@ -1498,7 +1498,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
smpte.drop= session->smpte_drop_frames();
|
||||
|
||||
session->smpte_to_sample( smpte, sample, false /* use_offset */, false /* use_subframes */ );
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
#define SMPTE_SAMPLE_TEST_1
|
||||
@@ -1533,7 +1533,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
cout << "smpte2: " << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
|
||||
cout << "ERROR: smpte2 not equal smpte1" << endl;
|
||||
cout << "smpte1: " << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1554,7 +1554,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
#ifdef SMPTE_SAMPLE_TEST_2
|
||||
// Test 2: use_offset = true, use_subframes = false
|
||||
cout << "use_offset = true, use_subframes = false" << endl;
|
||||
|
||||
|
||||
smpte1.hours = 0;
|
||||
smpte1.minutes = 0;
|
||||
smpte1.seconds = 0;
|
||||
@@ -1574,7 +1574,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
// cout << "sample: " << sample1 << endl;
|
||||
// cout << "sample: " << sample1 << " -> ";
|
||||
// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
|
||||
|
||||
if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1)))) {
|
||||
cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
|
||||
cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1583,7 +1583,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
|
||||
cout << "ERROR: smpte2 not equal smpte1" << endl;
|
||||
cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1603,7 +1603,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
|
||||
#ifdef SMPTE_SAMPLE_TEST_3
|
||||
// Test 3: use_offset = true, use_subframes = false, decrement
|
||||
cout << "use_offset = true, use_subframes = false, decrement" << endl;
|
||||
cout << "use_offset = true, use_subframes = false, decrement" << endl;
|
||||
|
||||
session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
|
||||
cout << "Starting at sample: " << sample1 << " -> ";
|
||||
@@ -1617,7 +1617,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
// cout << "sample: " << sample1 << endl;
|
||||
// cout << "sample: " << sample1 << " -> ";
|
||||
// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
|
||||
|
||||
if ((i > 0) && ( ((oldsample - sample1) != sample_increment) && ((oldsample - sample1) != (sample_increment + 1)) && ((oldsample - sample1) != (sample_increment - 1)))) {
|
||||
cout << "ERROR: sample increment not right: " << (oldsample - sample1) << " != " << sample_increment << endl;
|
||||
cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1626,7 +1626,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
|
||||
cout << "ERROR: smpte2 not equal smpte1" << endl;
|
||||
cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1648,7 +1648,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
#ifdef SMPTE_SAMPLE_TEST_4
|
||||
// Test 4: use_offset = true, use_subframes = true
|
||||
cout << "use_offset = true, use_subframes = true" << endl;
|
||||
|
||||
|
||||
for (long sub = 5; sub < 80; sub += 5) {
|
||||
smpte1.hours = 0;
|
||||
smpte1.minutes = 0;
|
||||
@@ -1656,16 +1656,16 @@ AudioClock::smpte_frame_from_display () const
|
||||
smpte1.frames = 0;
|
||||
smpte1.subframes = 0;
|
||||
sample1 = oldsample = (sample_increment * sub) / 80;
|
||||
|
||||
|
||||
session->sample_to_smpte( sample1, smpte1, true /* use_offset */, true /* use_subframes */ );
|
||||
|
||||
|
||||
cout << "starting at sample: " << sample1 << " -> ";
|
||||
cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
|
||||
|
||||
|
||||
for (int i = 0; i < 108003; i++) {
|
||||
session->smpte_to_sample( smpte1, sample1, true /* use_offset */, true /* use_subframes */ );
|
||||
session->sample_to_smpte( sample1, smpte2, true /* use_offset */, true /* use_subframes */ );
|
||||
|
||||
|
||||
if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1)))) {
|
||||
cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
|
||||
cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1674,7 +1674,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
//break;
|
||||
}
|
||||
|
||||
|
||||
if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames || smpte2.subframes != smpte1.subframes) {
|
||||
cout << "ERROR: smpte2 not equal smpte1" << endl;
|
||||
cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1686,7 +1686,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
oldsample = sample1;
|
||||
session->smpte_increment( smpte1 );
|
||||
}
|
||||
|
||||
|
||||
cout << "sample_increment: " << sample_increment << endl;
|
||||
cout << "sample: " << sample1 << " -> ";
|
||||
cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
@@ -1694,7 +1694,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
for (int i = 0; i < 108003; i++) {
|
||||
session->smpte_to_sample( smpte1, sample1, true /* use_offset */, true /* use_subframes */ );
|
||||
session->sample_to_smpte( sample1, smpte2, true /* use_offset */, true /* use_subframes */ );
|
||||
|
||||
|
||||
if ((i > 0) && ( ((oldsample - sample1) != sample_increment) && ((oldsample - sample1) != (sample_increment + 1)) && ((oldsample - sample1) != (sample_increment - 1)))) {
|
||||
cout << "ERROR: sample increment not right: " << (oldsample - sample1) << " != " << sample_increment << endl;
|
||||
cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1703,7 +1703,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
//break;
|
||||
}
|
||||
|
||||
|
||||
if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames || smpte2.subframes != smpte1.subframes) {
|
||||
cout << "ERROR: smpte2 not equal smpte1" << endl;
|
||||
cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1715,7 +1715,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
oldsample = sample1;
|
||||
session->smpte_decrement( smpte1 );
|
||||
}
|
||||
|
||||
|
||||
cout << "sample_decrement: " << sample_increment << endl;
|
||||
cout << "sample: " << sample1 << " -> ";
|
||||
cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
@@ -1726,7 +1726,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
#ifdef SMPTE_SAMPLE_TEST_5
|
||||
// Test 5: use_offset = true, use_subframes = false, increment seconds
|
||||
cout << "use_offset = true, use_subframes = false, increment seconds" << endl;
|
||||
|
||||
|
||||
smpte1.hours = 0;
|
||||
smpte1.minutes = 0;
|
||||
smpte1.seconds = 0;
|
||||
@@ -1747,13 +1747,13 @@ AudioClock::smpte_frame_from_display () const
|
||||
// cout << "sample: " << sample1 << endl;
|
||||
// cout << "sample: " << sample1 << " -> ";
|
||||
// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
|
||||
|
||||
// if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
|
||||
// {
|
||||
// cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
|
||||
// break;
|
||||
// }
|
||||
|
||||
|
||||
if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
|
||||
cout << "ERROR: smpte2 not equal smpte1" << endl;
|
||||
cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1775,7 +1775,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
#ifdef SMPTE_SAMPLE_TEST_6
|
||||
// Test 6: use_offset = true, use_subframes = false, increment minutes
|
||||
cout << "use_offset = true, use_subframes = false, increment minutes" << endl;
|
||||
|
||||
|
||||
smpte1.hours = 0;
|
||||
smpte1.minutes = 0;
|
||||
smpte1.seconds = 0;
|
||||
@@ -1796,13 +1796,13 @@ AudioClock::smpte_frame_from_display () const
|
||||
// cout << "sample: " << sample1 << endl;
|
||||
// cout << "sample: " << sample1 << " -> ";
|
||||
// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
|
||||
|
||||
// if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
|
||||
// {
|
||||
// cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
|
||||
// break;
|
||||
// }
|
||||
|
||||
|
||||
if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
|
||||
cout << "ERROR: smpte2 not equal smpte1" << endl;
|
||||
cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1823,7 +1823,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
#ifdef SMPTE_SAMPLE_TEST_7
|
||||
// Test 7: use_offset = true, use_subframes = false, increment hours
|
||||
cout << "use_offset = true, use_subframes = false, increment hours" << endl;
|
||||
|
||||
|
||||
smpte1.hours = 0;
|
||||
smpte1.minutes = 0;
|
||||
smpte1.seconds = 0;
|
||||
@@ -1844,13 +1844,13 @@ AudioClock::smpte_frame_from_display () const
|
||||
// cout << "sample: " << sample1 << endl;
|
||||
// cout << "sample: " << sample1 << " -> ";
|
||||
// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
|
||||
|
||||
// if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
|
||||
// {
|
||||
// cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
|
||||
// break;
|
||||
// }
|
||||
|
||||
|
||||
if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
|
||||
cout << "ERROR: smpte2 not equal smpte1" << endl;
|
||||
cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
|
||||
@@ -1868,7 +1868,7 @@ AudioClock::smpte_frame_from_display () const
|
||||
cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return sample;
|
||||
}
|
||||
@@ -1929,7 +1929,7 @@ AudioClock::bbt_frame_duration_from_display (nframes_t pos) const
|
||||
bbt.bars = atoi (bars_label.get_text());
|
||||
bbt.beats = atoi (beats_label.get_text());
|
||||
bbt.ticks = atoi (ticks_label.get_text());
|
||||
|
||||
|
||||
return session->tempo_map().bbt_duration_at(pos,bbt,1);
|
||||
}
|
||||
|
||||
@@ -1946,7 +1946,7 @@ AudioClock::build_ops_menu ()
|
||||
ops_menu = new Menu;
|
||||
MenuList& ops_items = ops_menu->items();
|
||||
ops_menu->set_name ("ArdourContextMenu");
|
||||
|
||||
|
||||
if (!Profile->get_sae()) {
|
||||
ops_items.push_back (MenuElem (_("Timecode"), bind (mem_fun(*this, &AudioClock::set_mode), SMPTE)));
|
||||
}
|
||||
@@ -1967,13 +1967,13 @@ AudioClock::set_mode (Mode m)
|
||||
*/
|
||||
|
||||
clock_base.grab_focus ();
|
||||
|
||||
|
||||
if (_mode == m) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
clock_base.remove ();
|
||||
|
||||
|
||||
_mode = m;
|
||||
|
||||
switch (_mode) {
|
||||
@@ -1999,7 +1999,7 @@ AudioClock::set_mode (Mode m)
|
||||
}
|
||||
|
||||
set_size_requests ();
|
||||
|
||||
|
||||
set (last_when, true);
|
||||
clock_base.show_all ();
|
||||
key_entry_state = 0;
|
||||
@@ -2042,7 +2042,7 @@ AudioClock::set_size_requests ()
|
||||
case Off:
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (off_hbox, "00000", 5, 5);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1999 Paul Davis
|
||||
Copyright (C) 1999 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
|
||||
@@ -41,7 +41,7 @@ class AudioClock : public Gtk::HBox
|
||||
Frames,
|
||||
Off
|
||||
};
|
||||
|
||||
|
||||
AudioClock (std::string clock_name, bool transient, std::string widget_name, bool editable, bool is_duration = false, bool with_info = false);
|
||||
|
||||
Mode mode() const { return _mode; }
|
||||
@@ -66,7 +66,7 @@ class AudioClock : public Gtk::HBox
|
||||
|
||||
static sigc::signal<void> ModeChanged;
|
||||
static std::vector<AudioClock*> clocks;
|
||||
|
||||
|
||||
static bool has_focus() { return _has_focus; }
|
||||
|
||||
private:
|
||||
@@ -91,7 +91,7 @@ class AudioClock : public Gtk::HBox
|
||||
|
||||
Gtk::HBox frames_packer_hbox;
|
||||
Gtk::HBox frames_packer;
|
||||
|
||||
|
||||
enum Field {
|
||||
SMPTE_Hours,
|
||||
SMPTE_Minutes,
|
||||
@@ -101,7 +101,7 @@ class AudioClock : public Gtk::HBox
|
||||
MS_Minutes,
|
||||
MS_Seconds,
|
||||
Bars,
|
||||
Beats,
|
||||
Beats,
|
||||
Ticks,
|
||||
AudioFrames
|
||||
};
|
||||
@@ -146,7 +146,7 @@ class AudioClock : public Gtk::HBox
|
||||
|
||||
Gtk::Label* smpte_upper_info_label;
|
||||
Gtk::Label* smpte_lower_info_label;
|
||||
|
||||
|
||||
Gtk::Label* bbt_upper_info_label;
|
||||
Gtk::Label* bbt_lower_info_label;
|
||||
|
||||
@@ -178,7 +178,7 @@ class AudioClock : public Gtk::HBox
|
||||
double drag_accum;
|
||||
|
||||
void on_realize ();
|
||||
|
||||
|
||||
bool field_motion_notify_event (GdkEventMotion *ev, Field);
|
||||
bool field_button_press_event (GdkEventButton *ev, Field);
|
||||
bool field_button_release_event (GdkEventButton *ev, Field);
|
||||
@@ -195,7 +195,7 @@ class AudioClock : public Gtk::HBox
|
||||
void set_frames (nframes_t, bool);
|
||||
|
||||
nframes_t get_frames (Field,nframes_t pos = 0,int dir=1);
|
||||
|
||||
|
||||
void smpte_sanitize_display();
|
||||
nframes_t smpte_frame_from_display () const;
|
||||
nframes_t bbt_frame_from_display (nframes_t) const;
|
||||
@@ -211,7 +211,7 @@ class AudioClock : public Gtk::HBox
|
||||
|
||||
static const uint32_t field_length[(int)AudioFrames+1];
|
||||
static bool _has_focus;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /* __audio_clock_h__ */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001 Paul Davis
|
||||
Copyright (C) 2001 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
|
||||
@@ -72,14 +72,14 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (audition_button, _("audition this region"));
|
||||
|
||||
audition_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
|
||||
|
||||
audition_button.set_events (audition_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
|
||||
top_row_button_hbox.set_border_width (5);
|
||||
top_row_button_hbox.set_spacing (5);
|
||||
top_row_button_hbox.set_homogeneous (false);
|
||||
top_row_button_hbox.pack_end (audition_button, false, false);
|
||||
|
||||
|
||||
top_row_hbox.pack_start (name_hbox, true, true);
|
||||
top_row_hbox.pack_end (top_row_button_hbox, true, true);
|
||||
|
||||
@@ -93,7 +93,7 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
|
||||
sync_label.set_text (_("SYNC POINT:"));
|
||||
start_label.set_name ("AudioRegionEditorLabel");
|
||||
start_label.set_text (_("FILE START:"));
|
||||
|
||||
|
||||
time_table.set_col_spacings (2);
|
||||
time_table.set_row_spacings (5);
|
||||
time_table.set_border_width (5);
|
||||
@@ -149,9 +149,9 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
|
||||
bounds_changed (Change (StartChanged|LengthChanged|PositionChanged|StartChanged|Region::SyncOffsetChanged));
|
||||
|
||||
_region->StateChanged.connect (mem_fun(*this, &AudioRegionEditor::region_changed));
|
||||
|
||||
|
||||
spin_arrow_grab = false;
|
||||
|
||||
|
||||
connect_editor_events ();
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ AudioRegionEditor::region_changed (Change what_changed)
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
gint
|
||||
AudioRegionEditor::bpressed (GdkEventButton* ev, Gtk::SpinButton* /*but*/, void (AudioRegionEditor::*/*pmf*/)())
|
||||
{
|
||||
switch (ev->button) {
|
||||
@@ -184,9 +184,9 @@ AudioRegionEditor::bpressed (GdkEventButton* ev, Gtk::SpinButton* /*but*/, void
|
||||
// if ((ev->window == but->gobj()->panel)) {
|
||||
// spin_arrow_grab = true;
|
||||
// (this->*pmf)();
|
||||
// }
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -194,7 +194,7 @@ AudioRegionEditor::bpressed (GdkEventButton* ev, Gtk::SpinButton* /*but*/, void
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gint
|
||||
gint
|
||||
AudioRegionEditor::breleased (GdkEventButton* /*ev*/, Gtk::SpinButton* /*but*/, void (AudioRegionEditor::*pmf)())
|
||||
{
|
||||
if (spin_arrow_grab) {
|
||||
@@ -240,7 +240,7 @@ AudioRegionEditor::end_clock_changed ()
|
||||
_session.begin_reversible_command (_("change region end position"));
|
||||
|
||||
boost::shared_ptr<Playlist> pl = _region->playlist();
|
||||
|
||||
|
||||
if (pl) {
|
||||
XMLNode &before = pl->get_state();
|
||||
_region->trim_end (end_clock.current_time(), this);
|
||||
@@ -257,9 +257,9 @@ void
|
||||
AudioRegionEditor::length_clock_changed ()
|
||||
{
|
||||
nframes_t frames = length_clock.current_time();
|
||||
|
||||
|
||||
_session.begin_reversible_command (_("change region length"));
|
||||
|
||||
|
||||
boost::shared_ptr<Playlist> pl = _region->playlist();
|
||||
|
||||
if (pl) {
|
||||
@@ -319,8 +319,8 @@ AudioRegionEditor::bounds_changed (Change what_changed)
|
||||
void
|
||||
AudioRegionEditor::activation ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::name_entry_changed ()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001 Paul Davis
|
||||
Copyright (C) 2001 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
|
||||
@@ -71,7 +71,7 @@ class AudioRegionEditor : public RegionEditor
|
||||
Gtk::ToggleButton audition_button;
|
||||
|
||||
Gtk::HBox lower_hbox;
|
||||
|
||||
|
||||
Gtk::Table time_table;
|
||||
|
||||
Gtk::Label position_label;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001-2006 Paul Davis
|
||||
Copyright (C) 2001-2006 Paul Davis
|
||||
|
||||
This program is free software; you can r>edistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -82,7 +82,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView
|
||||
}
|
||||
|
||||
|
||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||
Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
|
||||
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
|
||||
, sync_mark(0)
|
||||
@@ -118,7 +118,7 @@ AudioRegionView::AudioRegionView (const AudioRegionView& other)
|
||||
|
||||
UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
|
||||
c.set_rgb_p (r/255.0, g/255.0, b/255.0);
|
||||
|
||||
|
||||
init (c, false);
|
||||
}
|
||||
|
||||
@@ -149,9 +149,9 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
||||
{
|
||||
// FIXME: Some redundancy here with RegionView::init. Need to figure out
|
||||
// where order is important and where it isn't...
|
||||
|
||||
|
||||
RegionView::init (basic_color, wfd);
|
||||
|
||||
|
||||
XMLNode *node;
|
||||
|
||||
_amplitude_above_axis = 1.0;
|
||||
@@ -170,13 +170,13 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
||||
}
|
||||
|
||||
compute_colors (basic_color);
|
||||
|
||||
|
||||
create_waves ();
|
||||
|
||||
fade_in_shape = new ArdourCanvas::Polygon (*group);
|
||||
fade_in_shape->property_fill_color_rgba() = fade_color;
|
||||
fade_in_shape->set_data ("regionview", this);
|
||||
|
||||
|
||||
fade_out_shape = new ArdourCanvas::Polygon (*group);
|
||||
fade_out_shape->property_fill_color_rgba() = fade_color;
|
||||
fade_out_shape->set_data ("regionview", this);
|
||||
@@ -184,17 +184,17 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
||||
{
|
||||
uint32_t r,g,b,a;
|
||||
UINT_TO_RGBA(fill_color,&r,&g,&b,&a);
|
||||
|
||||
|
||||
fade_in_handle = new ArdourCanvas::SimpleRect (*group);
|
||||
fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
|
||||
fade_in_handle->property_outline_pixels() = 0;
|
||||
|
||||
|
||||
fade_in_handle->set_data ("regionview", this);
|
||||
|
||||
|
||||
fade_out_handle = new ArdourCanvas::SimpleRect (*group);
|
||||
fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
|
||||
fade_out_handle->property_outline_pixels() = 0;
|
||||
|
||||
|
||||
fade_out_handle->set_data ("regionview", this);
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ AudioRegionView::fade_in_active_changed ()
|
||||
fade_in_shape->property_fill_color_rgba() = col;
|
||||
fade_in_shape->property_width_pixels() = 0;
|
||||
fade_in_shape->property_outline_color_rgba() = RGBA_TO_UINT(r,g,b,0);
|
||||
} else {
|
||||
} else {
|
||||
col = RGBA_TO_UINT(r,g,b,0);
|
||||
fade_in_shape->property_fill_color_rgba() = col;
|
||||
fade_in_shape->property_width_pixels() = 1;
|
||||
@@ -335,7 +335,7 @@ AudioRegionView::fade_out_active_changed ()
|
||||
fade_out_shape->property_fill_color_rgba() = col;
|
||||
fade_out_shape->property_width_pixels() = 0;
|
||||
fade_out_shape->property_outline_color_rgba() = RGBA_TO_UINT(r,g,b,0);
|
||||
} else {
|
||||
} else {
|
||||
col = RGBA_TO_UINT(r,g,b,0);
|
||||
fade_out_shape->property_fill_color_rgba() = col;
|
||||
fade_out_shape->property_width_pixels() = 1;
|
||||
@@ -359,7 +359,7 @@ void
|
||||
AudioRegionView::region_renamed ()
|
||||
{
|
||||
Glib::ustring str = RegionView::make_name ();
|
||||
|
||||
|
||||
if (audio_region()->speed_mismatch (trackview.session().frame_rate())) {
|
||||
str = string ("*") + str;
|
||||
}
|
||||
@@ -384,7 +384,7 @@ AudioRegionView::region_resized (Change what_changed)
|
||||
for (uint32_t n = 0; n < waves.size(); ++n) {
|
||||
waves[n]->property_region_start() = _region->start();
|
||||
}
|
||||
|
||||
|
||||
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
||||
if((agr = dynamic_cast<AudioGhostRegion*>(*i)) != 0) {
|
||||
|
||||
@@ -452,7 +452,7 @@ AudioRegionView::setup_fade_handle_positions()
|
||||
fade_in_handle->property_y1() = handle_pos;
|
||||
fade_in_handle->property_y2() = handle_pos + handle_height;
|
||||
}
|
||||
|
||||
|
||||
if (fade_out_handle) {
|
||||
fade_out_handle->property_y1() = handle_pos;
|
||||
fade_out_handle->property_y2() = handle_pos + handle_height;
|
||||
@@ -468,7 +468,7 @@ AudioRegionView::set_height (gdouble height)
|
||||
|
||||
// FIXME: ick
|
||||
height -= 2;
|
||||
|
||||
|
||||
_height = height;
|
||||
|
||||
for (uint32_t n=0; n < wcnt; ++n) {
|
||||
@@ -479,9 +479,9 @@ AudioRegionView::set_height (gdouble height)
|
||||
} else {
|
||||
ht = (((height-2*wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
|
||||
}
|
||||
|
||||
|
||||
gdouble yoff = n * (ht+1);
|
||||
|
||||
|
||||
waves[n]->property_height() = ht;
|
||||
waves[n]->property_y() = yoff + 2;
|
||||
}
|
||||
@@ -535,7 +535,7 @@ AudioRegionView::reset_fade_in_shape ()
|
||||
{
|
||||
reset_fade_in_shape_width ((nframes_t) audio_region()->fade_in()->back()->when);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioRegionView::reset_fade_in_shape_width (nframes_t width)
|
||||
{
|
||||
@@ -550,8 +550,8 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
|
||||
Points* points;
|
||||
double pwidth = width / samples_per_unit;
|
||||
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
||||
double h;
|
||||
|
||||
double h;
|
||||
|
||||
if (_height < 5) {
|
||||
fade_in_shape->hide();
|
||||
fade_in_handle->hide();
|
||||
@@ -560,7 +560,7 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
|
||||
|
||||
double handle_center;
|
||||
handle_center = pwidth;
|
||||
|
||||
|
||||
if (handle_center > 7.0) {
|
||||
handle_center -= 3.0;
|
||||
} else {
|
||||
@@ -569,7 +569,7 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
|
||||
|
||||
fade_in_handle->property_x1() = handle_center - 3.0;
|
||||
fade_in_handle->property_x2() = handle_center + 3.0;
|
||||
|
||||
|
||||
if (pwidth < 5) {
|
||||
fade_in_shape->hide();
|
||||
return;
|
||||
@@ -599,7 +599,7 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
|
||||
(*points)[pi].set_x(1 + (pc * xdelta));
|
||||
(*points)[pi++].set_y(2 + (h - (curve[pc] * h)));
|
||||
}
|
||||
|
||||
|
||||
/* fold back */
|
||||
|
||||
(*points)[pi].set_x(pwidth);
|
||||
@@ -611,10 +611,10 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
|
||||
/* connect the dots ... */
|
||||
|
||||
(*points)[pi] = (*points)[0];
|
||||
|
||||
|
||||
fade_in_shape->property_points() = *points;
|
||||
delete points;
|
||||
|
||||
|
||||
/* ensure trim handle stays on top */
|
||||
frame_handle_start->raise_to_top();
|
||||
}
|
||||
@@ -627,7 +627,7 @@ AudioRegionView::reset_fade_out_shape ()
|
||||
|
||||
void
|
||||
AudioRegionView::reset_fade_out_shape_width (nframes_t width)
|
||||
{
|
||||
{
|
||||
if (fade_out_handle == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -649,23 +649,23 @@ AudioRegionView::reset_fade_out_shape_width (nframes_t width)
|
||||
|
||||
double handle_center;
|
||||
handle_center = (_region->length() - width) / samples_per_unit;
|
||||
|
||||
|
||||
if (handle_center > 7.0) {
|
||||
handle_center -= 3.0;
|
||||
} else {
|
||||
handle_center = 3.0;
|
||||
}
|
||||
|
||||
|
||||
fade_out_handle->property_x1() = handle_center - 3.0;
|
||||
fade_out_handle->property_x2() = handle_center + 3.0;
|
||||
|
||||
/* don't show shape if its too small */
|
||||
|
||||
|
||||
if (pwidth < 5) {
|
||||
fade_out_shape->hide();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (trackview.session().config.get_show_region_fades()) {
|
||||
fade_out_shape->show();
|
||||
}
|
||||
@@ -690,7 +690,7 @@ AudioRegionView::reset_fade_out_shape_width (nframes_t width)
|
||||
(*points)[pi].set_x(_pixel_width - 1 - pwidth + (pc*xdelta));
|
||||
(*points)[pi++].set_y(2 + (h - (curve[pc] * h)));
|
||||
}
|
||||
|
||||
|
||||
/* fold back */
|
||||
|
||||
(*points)[pi].set_x(_pixel_width);
|
||||
@@ -705,7 +705,7 @@ AudioRegionView::reset_fade_out_shape_width (nframes_t width)
|
||||
|
||||
fade_out_shape->property_points() = *points;
|
||||
delete points;
|
||||
|
||||
|
||||
/* ensure trim handle stays on top */
|
||||
frame_handle_end->raise_to_top();
|
||||
}
|
||||
@@ -740,7 +740,7 @@ void
|
||||
AudioRegionView::compute_colors (Gdk::Color const & basic_color)
|
||||
{
|
||||
RegionView::compute_colors (basic_color);
|
||||
|
||||
|
||||
uint32_t r, g, b, a;
|
||||
|
||||
/* gain color computed in envelope_active_changed() */
|
||||
@@ -753,7 +753,7 @@ void
|
||||
AudioRegionView::set_colors ()
|
||||
{
|
||||
RegionView::set_colors();
|
||||
|
||||
|
||||
if (gain_line) {
|
||||
gain_line->set_line_color (audio_region()->envelope_active() ? ARDOUR_UI::config()->canvasvar_GainLine.get() : ARDOUR_UI::config()->canvasvar_GainLineInactive.get());
|
||||
}
|
||||
@@ -778,7 +778,7 @@ AudioRegionView::show_region_editor ()
|
||||
// GTK2FIX : how to ensure float without realizing
|
||||
// editor->realize ();
|
||||
// trackview.editor.ensure_float (*editor);
|
||||
}
|
||||
}
|
||||
|
||||
editor->present ();
|
||||
editor->show_all();
|
||||
@@ -852,18 +852,18 @@ AudioRegionView::create_waves ()
|
||||
|
||||
// cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data
|
||||
// << " and channels = " << nchans.n_audio() << endl;
|
||||
|
||||
|
||||
/* in tmp_waves, set up null pointers for each channel so the vector is allocated */
|
||||
for (uint32_t n = 0; n < nchans.n_audio(); ++n) {
|
||||
tmp_waves.push_back (0);
|
||||
}
|
||||
|
||||
for (uint32_t n = 0; n < nchans.n_audio(); ++n) {
|
||||
|
||||
|
||||
if (n >= audio_region()->n_channels()) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
wave_caches.push_back (WaveView::create_cache ());
|
||||
|
||||
// cerr << "\tchannel " << n << endl;
|
||||
@@ -877,7 +877,7 @@ AudioRegionView::create_waves ()
|
||||
// we'll get a PeaksReady signal from the source in the future
|
||||
// and will call create_one_wave(n) then.
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// cerr << "\tdon't delay, display today!\n";
|
||||
create_one_wave (n, true);
|
||||
@@ -948,9 +948,9 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
|
||||
} else {
|
||||
/* n-channel track, >n-channel source */
|
||||
}
|
||||
|
||||
|
||||
/* see if we're all ready */
|
||||
|
||||
|
||||
for (n = 0; n < nchans; ++n) {
|
||||
if (tmp_waves[n] == 0) {
|
||||
break;
|
||||
@@ -965,7 +965,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
|
||||
tmp_waves.clear ();
|
||||
|
||||
/* all waves created, don't hook into peaks ready anymore */
|
||||
data_ready_connection.disconnect ();
|
||||
data_ready_connection.disconnect ();
|
||||
|
||||
#if 0
|
||||
if (!zero_line) {
|
||||
@@ -998,7 +998,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
|
||||
/* don't create points that can't be seen */
|
||||
|
||||
set_envelope_visible (true);
|
||||
|
||||
|
||||
x = ev->button.x;
|
||||
y = ev->button.y;
|
||||
|
||||
@@ -1029,7 +1029,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
|
||||
}
|
||||
|
||||
audio_region()->envelope()->add (fx, y);
|
||||
|
||||
|
||||
XMLNode &after = audio_region()->envelope()->get_state();
|
||||
trackview.session().add_command (new MementoCommand<AutomationList>(*audio_region()->envelope().get(), &before, &after));
|
||||
trackview.session().commit_reversible_command ();
|
||||
@@ -1084,13 +1084,13 @@ AudioRegionView::set_flags (XMLNode* node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioRegionView::set_waveform_shape (WaveformShape shape)
|
||||
{
|
||||
bool yn;
|
||||
|
||||
/* this slightly odd approach is to leave the door open to
|
||||
/* this slightly odd approach is to leave the door open to
|
||||
other "shapes" such as spectral displays, etc.
|
||||
*/
|
||||
|
||||
@@ -1155,15 +1155,15 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
|
||||
double unit_position = _region->position () / samples_per_unit;
|
||||
AudioGhostRegion* ghost = new AudioGhostRegion (tv, trackview, unit_position);
|
||||
uint32_t nchans;
|
||||
|
||||
|
||||
nchans = rtv->get_diskstream()->n_channels().n_audio();
|
||||
|
||||
for (uint32_t n = 0; n < nchans; ++n) {
|
||||
|
||||
|
||||
if (n >= audio_region()->n_channels()) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
WaveView *wave = new WaveView(*ghost->group);
|
||||
|
||||
wave->property_data_src() = _region.get();
|
||||
@@ -1202,7 +1202,7 @@ AudioRegionView::entered ()
|
||||
uint32_t r,g,b,a;
|
||||
UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
|
||||
a=255;
|
||||
|
||||
|
||||
if (fade_in_handle) {
|
||||
fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
|
||||
fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
|
||||
@@ -1215,11 +1215,11 @@ AudioRegionView::exited ()
|
||||
if (gain_line) {
|
||||
gain_line->hide_all_but_selected_control_points ();
|
||||
}
|
||||
|
||||
|
||||
uint32_t r,g,b,a;
|
||||
UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
|
||||
a=0;
|
||||
|
||||
|
||||
if (fade_in_handle) {
|
||||
fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
|
||||
fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
|
||||
@@ -1244,11 +1244,11 @@ AudioRegionView::set_waveview_data_src()
|
||||
// TODO: something else to let it know the channel
|
||||
waves[n]->property_data_src() = _region.get();
|
||||
}
|
||||
|
||||
|
||||
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
||||
|
||||
|
||||
(*i)->set_duration (unit_length);
|
||||
|
||||
|
||||
if((agr = dynamic_cast<AudioGhostRegion*>(*i)) != 0) {
|
||||
for (vector<WaveView*>::iterator w = agr->waves.begin(); w != agr->waves.end(); ++w) {
|
||||
(*w)->property_data_src() = _region.get();
|
||||
@@ -1287,7 +1287,7 @@ AudioRegionView::set_frame_color ()
|
||||
}
|
||||
|
||||
uint32_t r,g,b,a;
|
||||
|
||||
|
||||
if (_selected && should_show_selection) {
|
||||
UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get(), &r, &g, &b, &a);
|
||||
frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);
|
||||
@@ -1338,10 +1338,10 @@ AudioRegionView::set_fade_visibility (bool yn)
|
||||
}
|
||||
if (fade_out_shape) {
|
||||
fade_out_shape->show ();
|
||||
}
|
||||
}
|
||||
if (fade_in_handle) {
|
||||
fade_in_handle->show ();
|
||||
}
|
||||
}
|
||||
if (fade_out_handle) {
|
||||
fade_out_handle->show ();
|
||||
}
|
||||
@@ -1351,10 +1351,10 @@ AudioRegionView::set_fade_visibility (bool yn)
|
||||
}
|
||||
if (fade_out_shape) {
|
||||
fade_out_shape->hide ();
|
||||
}
|
||||
}
|
||||
if (fade_in_handle) {
|
||||
fade_in_handle->hide ();
|
||||
}
|
||||
}
|
||||
if (fade_out_handle) {
|
||||
fade_out_handle->hide ();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001-2006 Paul Davis
|
||||
Copyright (C) 2001-2006 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
|
||||
@@ -48,13 +48,13 @@ class RouteTimeAxisView;
|
||||
class AudioRegionView : public RegionView
|
||||
{
|
||||
public:
|
||||
AudioRegionView (ArdourCanvas::Group *,
|
||||
AudioRegionView (ArdourCanvas::Group *,
|
||||
RouteTimeAxisView&,
|
||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||
double initial_samples_per_unit,
|
||||
Gdk::Color const & basic_color);
|
||||
|
||||
AudioRegionView (ArdourCanvas::Group *,
|
||||
AudioRegionView (ArdourCanvas::Group *,
|
||||
RouteTimeAxisView&,
|
||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||
double samples_per_unit,
|
||||
@@ -66,43 +66,43 @@ class AudioRegionView : public RegionView
|
||||
AudioRegionView (const AudioRegionView& other, boost::shared_ptr<ARDOUR::AudioRegion>);
|
||||
|
||||
~AudioRegionView ();
|
||||
|
||||
|
||||
virtual void init (Gdk::Color const & base_color, bool wait_for_data);
|
||||
|
||||
|
||||
boost::shared_ptr<ARDOUR::AudioRegion> audio_region() const;
|
||||
|
||||
|
||||
void create_waves ();
|
||||
|
||||
void set_height (double);
|
||||
void set_samples_per_unit (double);
|
||||
|
||||
|
||||
void set_amplitude_above_axis (gdouble spp);
|
||||
|
||||
|
||||
void temporarily_hide_envelope (); ///< Dangerous!
|
||||
void unhide_envelope (); ///< Dangerous!
|
||||
|
||||
|
||||
void set_envelope_visible (bool);
|
||||
void set_waveform_visible (bool yn);
|
||||
void set_waveform_shape (ARDOUR::WaveformShape);
|
||||
void set_waveform_scale (ARDOUR::WaveformScale);
|
||||
|
||||
|
||||
bool waveform_rectified() const { return _flags & WaveformRectified; }
|
||||
bool waveform_logscaled() const { return _flags & WaveformLogScaled; }
|
||||
bool waveform_visible() const { return _flags & WaveformVisible; }
|
||||
bool envelope_visible() const { return _flags & EnvelopeVisible; }
|
||||
|
||||
|
||||
void show_region_editor ();
|
||||
|
||||
|
||||
void add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event);
|
||||
void remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event);
|
||||
|
||||
|
||||
AudioRegionGainLine* get_gain_line() const { return gain_line; }
|
||||
|
||||
|
||||
void region_changed (ARDOUR::Change);
|
||||
void envelope_active_changed ();
|
||||
|
||||
|
||||
GhostRegion* add_ghost (TimeAxisView&);
|
||||
|
||||
|
||||
void reset_fade_in_shape_width (nframes_t);
|
||||
void reset_fade_out_shape_width (nframes_t);
|
||||
|
||||
@@ -111,14 +111,14 @@ class AudioRegionView : public RegionView
|
||||
|
||||
virtual void entered ();
|
||||
virtual void exited ();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
/* this constructor allows derived types
|
||||
to specify their visibility requirements
|
||||
to the TimeAxisViewItem parent class
|
||||
*/
|
||||
|
||||
|
||||
enum Flags {
|
||||
EnvelopeVisible = 0x1,
|
||||
WaveformVisible = 0x4,
|
||||
@@ -128,20 +128,20 @@ class AudioRegionView : public RegionView
|
||||
|
||||
std::vector<ArdourCanvas::WaveView *> waves;
|
||||
std::vector<ArdourCanvas::WaveView *> tmp_waves; ///< see ::create_waves()
|
||||
ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position
|
||||
ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position
|
||||
ArdourCanvas::SimpleLine* zero_line;
|
||||
ArdourCanvas::Polygon* fade_in_shape;
|
||||
ArdourCanvas::Polygon* fade_out_shape;
|
||||
ArdourCanvas::SimpleRect* fade_in_handle;
|
||||
ArdourCanvas::SimpleRect* fade_out_handle;
|
||||
|
||||
|
||||
AudioRegionGainLine * gain_line;
|
||||
|
||||
double _amplitude_above_axis;
|
||||
|
||||
uint32_t _flags;
|
||||
uint32_t fade_color;
|
||||
|
||||
|
||||
void reset_fade_shapes ();
|
||||
void reset_fade_in_shape ();
|
||||
void reset_fade_out_shape ();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001, 2006 Paul Davis
|
||||
Copyright (C) 2001, 2006 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
|
||||
@@ -71,7 +71,7 @@ AudioStreamView::~AudioStreamView ()
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
AudioStreamView::set_samples_per_unit (gdouble spp)
|
||||
{
|
||||
StreamView::set_samples_per_unit(spp);
|
||||
@@ -83,7 +83,7 @@ AudioStreamView::set_samples_per_unit (gdouble spp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
AudioStreamView::set_amplitude_above_axis (gdouble app)
|
||||
{
|
||||
RegionViewList::iterator i;
|
||||
@@ -114,20 +114,20 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
|
||||
}
|
||||
|
||||
switch (_trackview.audio_track()->mode()) {
|
||||
|
||||
|
||||
case NonLayered:
|
||||
case Normal:
|
||||
if (recording) {
|
||||
region_view = new AudioRegionView (canvas_group, _trackview, region,
|
||||
region_view = new AudioRegionView (canvas_group, _trackview, region,
|
||||
_samples_per_unit, region_color, recording, TimeAxisViewItem::Visibility(
|
||||
TimeAxisViewItem::ShowFrame | TimeAxisViewItem::HideFrameRight));
|
||||
} else {
|
||||
region_view = new AudioRegionView (canvas_group, _trackview, region,
|
||||
region_view = new AudioRegionView (canvas_group, _trackview, region,
|
||||
_samples_per_unit, region_color);
|
||||
}
|
||||
break;
|
||||
case Destructive:
|
||||
region_view = new TapeAudioRegionView (canvas_group, _trackview, region,
|
||||
region_view = new TapeAudioRegionView (canvas_group, _trackview, region,
|
||||
_samples_per_unit, region_color);
|
||||
break;
|
||||
default:
|
||||
@@ -140,8 +140,8 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
|
||||
region_view->set_amplitude_above_axis(_amplitude_above_axis);
|
||||
region_view->set_height (child_height ());
|
||||
|
||||
/* if its the special single-sample length that we use for rec-regions, make it
|
||||
insensitive to events
|
||||
/* if its the special single-sample length that we use for rec-regions, make it
|
||||
insensitive to events
|
||||
*/
|
||||
|
||||
if (region->length() == 1) {
|
||||
@@ -152,7 +152,7 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
|
||||
region_view->set_waveform_shape (Config->get_waveform_shape ());
|
||||
region_view->set_waveform_visible (Config->get_show_waveforms ());
|
||||
|
||||
return region_view;
|
||||
return region_view;
|
||||
}
|
||||
|
||||
RegionView*
|
||||
@@ -168,7 +168,7 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
|
||||
// if ((*i)->region() == r) {
|
||||
// cerr << "audio_streamview in add_region_view_internal region found" << endl;
|
||||
/* great. we already have a AudioRegionView for this Region. use it again. */
|
||||
|
||||
|
||||
// (*i)->set_valid (true);
|
||||
|
||||
// this might not be necessary
|
||||
@@ -178,7 +178,7 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
|
||||
// arv->set_waveform_scale (_waveform_scale);
|
||||
// arv->set_waveform_shape (_waveform_shape);
|
||||
// }
|
||||
|
||||
|
||||
// return NULL;
|
||||
// }
|
||||
// }
|
||||
@@ -209,16 +209,16 @@ AudioStreamView::remove_region_view (boost::weak_ptr<Region> weak_r)
|
||||
|
||||
for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end();) {
|
||||
CrossfadeViewList::iterator tmp;
|
||||
|
||||
|
||||
tmp = i;
|
||||
++tmp;
|
||||
|
||||
|
||||
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(r);
|
||||
if (ar && i->second->crossfade->involves (ar)) {
|
||||
delete i->second;
|
||||
crossfade_views.erase (i);
|
||||
}
|
||||
|
||||
|
||||
i = tmp;
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ AudioStreamView::playlist_modified (boost::shared_ptr<Diskstream> ds)
|
||||
ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::playlist_modified_weak), ds));
|
||||
|
||||
StreamView::playlist_modified (ds);
|
||||
|
||||
|
||||
/* make sure xfades are on top and all the regionviews are stacked correctly. */
|
||||
|
||||
for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
||||
@@ -306,7 +306,7 @@ AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
|
||||
AudioRegionView* rview = 0;
|
||||
|
||||
/* we do not allow shared_ptr<T> to be bound to slots */
|
||||
|
||||
|
||||
ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::add_crossfade_weak), boost::weak_ptr<Crossfade> (crossfade)));
|
||||
|
||||
/* first see if we already have a CrossfadeView for this Crossfade */
|
||||
@@ -397,12 +397,12 @@ AudioStreamView::redisplay_diskstream ()
|
||||
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(
|
||||
_trackview.get_diskstream()->playlist()
|
||||
);
|
||||
|
||||
|
||||
if (apl) {
|
||||
apl->foreach_crossfade (sigc::mem_fun (*this, &AudioStreamView::add_crossfade));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Remove invalid crossfade views
|
||||
for (xi = crossfade_views.begin(); xi != crossfade_views.end();) {
|
||||
tmpx = xi;
|
||||
@@ -439,7 +439,7 @@ AudioStreamView::set_waveform_shape (WaveformShape shape)
|
||||
if (arv)
|
||||
arv->set_waveform_shape (shape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioStreamView::set_waveform_scale (WaveformScale scale)
|
||||
@@ -450,7 +450,7 @@ AudioStreamView::set_waveform_scale (WaveformScale scale)
|
||||
arv->set_waveform_scale (scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioStreamView::setup_rec_box ()
|
||||
@@ -461,8 +461,8 @@ AudioStreamView::setup_rec_box ()
|
||||
|
||||
// cerr << "\trolling\n";
|
||||
|
||||
if (!rec_active &&
|
||||
_trackview.session().record_status() == Session::Recording &&
|
||||
if (!rec_active &&
|
||||
_trackview.session().record_status() == Session::Recording &&
|
||||
_trackview.get_diskstream()->record_enabled()) {
|
||||
if (_trackview.audio_track()->mode() == Normal && use_rec_regions && rec_regions.size() == rec_rects.size()) {
|
||||
|
||||
@@ -474,7 +474,7 @@ AudioStreamView::setup_rec_box ()
|
||||
(*prc).disconnect();
|
||||
}
|
||||
rec_data_ready_connections.clear();
|
||||
|
||||
|
||||
// FIXME
|
||||
boost::shared_ptr<AudioDiskstream> ads = boost::dynamic_pointer_cast<AudioDiskstream>(_trackview.get_diskstream());
|
||||
assert(ads);
|
||||
@@ -483,19 +483,19 @@ AudioStreamView::setup_rec_box ()
|
||||
boost::shared_ptr<AudioFileSource> src = boost::static_pointer_cast<AudioFileSource> (ads->write_source (n));
|
||||
if (src) {
|
||||
sources.push_back (src);
|
||||
|
||||
|
||||
rec_data_ready_connections.push_back (src->PeakRangeReady.connect (bind
|
||||
(mem_fun (*this, &AudioStreamView::rec_peak_range_ready), boost::weak_ptr<Source>(src))));
|
||||
(mem_fun (*this, &AudioStreamView::rec_peak_range_ready), boost::weak_ptr<Source>(src))));
|
||||
}
|
||||
}
|
||||
|
||||
// handle multi
|
||||
|
||||
|
||||
nframes_t start = 0;
|
||||
if (rec_regions.size() > 0) {
|
||||
start = rec_regions.back().first->start() + _trackview.get_diskstream()->get_captured_frames(rec_regions.size()-1);
|
||||
}
|
||||
|
||||
|
||||
boost::shared_ptr<AudioRegion> region (boost::dynamic_pointer_cast<AudioRegion>
|
||||
(RegionFactory::create (sources, start, 1 , "", 0, (Region::Flag)(Region::DefaultFlags), false)));
|
||||
assert(region);
|
||||
@@ -503,7 +503,7 @@ AudioStreamView::setup_rec_box ()
|
||||
region->set_position (_trackview.session().transport_frame(), this);
|
||||
rec_regions.push_back (make_pair(region, (RegionView*)0));
|
||||
}
|
||||
|
||||
|
||||
/* start a new rec box */
|
||||
|
||||
boost::shared_ptr<AudioTrack> at;
|
||||
@@ -531,7 +531,7 @@ AudioStreamView::setup_rec_box ()
|
||||
fill_color = UINT_RGBA_CHANGE_A (fill_color, 120);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
ArdourCanvas::SimpleRect * rec_rect = new Gnome::Canvas::SimpleRect (*canvas_group);
|
||||
rec_rect->property_x1() = xstart;
|
||||
rec_rect->property_y1() = 1.0;
|
||||
@@ -541,16 +541,16 @@ AudioStreamView::setup_rec_box ()
|
||||
rec_rect->property_outline_what() = 0x1 | 0x2 | 0x4 | 0x8;
|
||||
rec_rect->property_fill_color_rgba() = fill_color;
|
||||
rec_rect->lower_to_bottom();
|
||||
|
||||
|
||||
RecBoxInfo recbox;
|
||||
recbox.rectangle = rec_rect;
|
||||
recbox.start = _trackview.session().transport_frame();
|
||||
recbox.length = 0;
|
||||
|
||||
|
||||
rec_rects.push_back (recbox);
|
||||
|
||||
|
||||
screen_update_connection.disconnect();
|
||||
screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (mem_fun (*this, &AudioStreamView::update_rec_box));
|
||||
screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (mem_fun (*this, &AudioStreamView::update_rec_box));
|
||||
rec_updating = true;
|
||||
rec_active = true;
|
||||
|
||||
@@ -561,7 +561,7 @@ AudioStreamView::setup_rec_box ()
|
||||
rec_active = false;
|
||||
rec_updating = false;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
// cerr << "\tNOT rolling, rec_rects = " << rec_rects.size() << " rec_regions = " << rec_regions.size() << endl;
|
||||
@@ -578,7 +578,7 @@ AudioStreamView::setup_rec_box ()
|
||||
|
||||
rec_updating = false;
|
||||
rec_active = false;
|
||||
|
||||
|
||||
/* remove temp regions */
|
||||
|
||||
for (list<pair<boost::shared_ptr<Region>,RegionView*> >::iterator iter = rec_regions.begin(); iter != rec_regions.end(); ) {
|
||||
@@ -591,7 +591,7 @@ AudioStreamView::setup_rec_box ()
|
||||
|
||||
iter = tmp;
|
||||
}
|
||||
|
||||
|
||||
rec_regions.clear();
|
||||
|
||||
// cerr << "\tclear " << rec_rects.size() << " rec rects\n";
|
||||
@@ -601,9 +601,9 @@ AudioStreamView::setup_rec_box ()
|
||||
RecBoxInfo &rect = (*iter);
|
||||
delete rect.rectangle;
|
||||
}
|
||||
|
||||
|
||||
rec_rects.clear();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -620,21 +620,21 @@ void
|
||||
AudioStreamView::rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<Source> weak_src)
|
||||
{
|
||||
ENSURE_GUI_THREAD(bind (mem_fun (*this, &AudioStreamView::rec_peak_range_ready), start, cnt, weak_src));
|
||||
|
||||
|
||||
boost::shared_ptr<Source> src (weak_src.lock());
|
||||
|
||||
if (!src) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// this is called from the peak building thread
|
||||
|
||||
|
||||
if (rec_data_ready_map.size() == 0 || start+cnt > last_rec_data_frame) {
|
||||
last_rec_data_frame = start + cnt;
|
||||
}
|
||||
|
||||
|
||||
rec_data_ready_map[src] = true;
|
||||
|
||||
|
||||
if (rec_data_ready_map.size() == _trackview.get_diskstream()->n_channels().n_audio()) {
|
||||
this->update_rec_regions ();
|
||||
rec_data_ready_map.clear();
|
||||
@@ -659,7 +659,7 @@ AudioStreamView::update_rec_regions ()
|
||||
iter = tmp;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion>(iter->first);
|
||||
if (!region) {
|
||||
continue;
|
||||
@@ -704,12 +704,12 @@ AudioStreamView::update_rec_regions ()
|
||||
region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_length (nlen, this);
|
||||
region->thaw ("updated");
|
||||
|
||||
|
||||
if (origlen == 1) {
|
||||
/* our special initial length */
|
||||
add_region_view_internal (region, false, true);
|
||||
}
|
||||
|
||||
|
||||
/* also hide rect */
|
||||
ArdourCanvas::Item * rect = rec_rects[n].rectangle;
|
||||
rect->hide();
|
||||
@@ -785,7 +785,7 @@ AudioStreamView::color_handler ()
|
||||
//case cAudioTrackBase:
|
||||
if (_trackview.is_track()) {
|
||||
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_AudioTrackBase.get();
|
||||
}
|
||||
}
|
||||
|
||||
//case cAudioBusBase:
|
||||
if (!_trackview.is_track()) {
|
||||
@@ -811,25 +811,25 @@ void
|
||||
AudioStreamView::update_content_height (CrossfadeView* cv)
|
||||
{
|
||||
cv->show ();
|
||||
|
||||
|
||||
if (_layer_display == Overlaid) {
|
||||
|
||||
|
||||
cv->set_y (0);
|
||||
cv->set_height (height);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
layer_t const inl = cv->crossfade->in()->layer ();
|
||||
layer_t const outl = cv->crossfade->out()->layer ();
|
||||
|
||||
layer_t const high = max (inl, outl);
|
||||
layer_t const low = min (inl, outl);
|
||||
|
||||
|
||||
const double h = child_height ();
|
||||
|
||||
cv->set_y ((_layers - high - 1) * h);
|
||||
cv->set_height ((high - low + 1) * h);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001, 2006 Paul Davis
|
||||
Copyright (C) 2001, 2006 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
|
||||
@@ -79,9 +79,9 @@ class AudioStreamView : public StreamView
|
||||
|
||||
private:
|
||||
void setup_rec_box ();
|
||||
void rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<ARDOUR::Source> src);
|
||||
void rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<ARDOUR::Source> src);
|
||||
void update_rec_regions ();
|
||||
|
||||
|
||||
RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool recording = false);
|
||||
void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
|
||||
void remove_audio_region_view (boost::shared_ptr<ARDOUR::AudioRegion> );
|
||||
@@ -105,9 +105,9 @@ class AudioStreamView : public StreamView
|
||||
void parameter_changed (std::string const &);
|
||||
void set_waveform_shape (ARDOUR::WaveformShape);
|
||||
void set_waveform_scale (ARDOUR::WaveformScale);
|
||||
|
||||
|
||||
double _amplitude_above_axis;
|
||||
|
||||
|
||||
typedef std::map<boost::shared_ptr<ARDOUR::Crossfade>, CrossfadeView*> CrossfadeViewList;
|
||||
CrossfadeViewList crossfade_views;
|
||||
bool crossfades_visible;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2006 Paul Davis
|
||||
Copyright (C) 2000-2006 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
|
||||
@@ -91,7 +91,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
|
||||
|
||||
mute_button->set_active (false);
|
||||
solo_button->set_active (false);
|
||||
|
||||
|
||||
if (is_audio_track()) {
|
||||
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
|
||||
} else { // bus
|
||||
@@ -106,7 +106,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
|
||||
if (automation_track (GainAutomation) == 0) {
|
||||
create_automation_child (GainAutomation, false);
|
||||
}
|
||||
|
||||
|
||||
if (_route->panner()) {
|
||||
_route->panner()->Changed.connect (bind (
|
||||
mem_fun(*this, &AudioTimeAxisView::ensure_pan_views),
|
||||
@@ -158,7 +158,7 @@ AudioTimeAxisView::show_at (double y, int& nth, Gtk::VBox *parent)
|
||||
{
|
||||
ensure_xml_node ();
|
||||
xml_node->add_property ("shown-editor", "yes");
|
||||
|
||||
|
||||
return TimeAxisView::show_at (y, nth, parent);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ AudioTimeAxisView::append_extra_display_menu_items ()
|
||||
items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Gtk::Menu*
|
||||
AudioTimeAxisView::build_mode_menu()
|
||||
{
|
||||
@@ -245,7 +245,7 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<AutomationTimeAxisView>
|
||||
boost::shared_ptr<AutomationTimeAxisView>
|
||||
gain_track(new AutomationTimeAxisView (_session,
|
||||
_route, _route->amp(), c,
|
||||
_editor,
|
||||
@@ -285,7 +285,7 @@ AudioTimeAxisView::ensure_pan_views (bool show)
|
||||
boost::shared_ptr<ARDOUR::AutomationControl> pan_control
|
||||
= boost::dynamic_pointer_cast<ARDOUR::AutomationControl>(
|
||||
_route->panner()->data().control(*p));
|
||||
|
||||
|
||||
if (pan_control->parameter().type() == NullAutomation) {
|
||||
error << "Pan control has NULL automation type!" << endmsg;
|
||||
continue;
|
||||
@@ -299,13 +299,13 @@ AudioTimeAxisView::ensure_pan_views (bool show)
|
||||
|
||||
boost::shared_ptr<AutomationTimeAxisView> pan_track (
|
||||
new AutomationTimeAxisView (_session,
|
||||
_route, _route->panner(), pan_control,
|
||||
_route, _route->panner(), pan_control,
|
||||
_editor,
|
||||
*this,
|
||||
false,
|
||||
parent_canvas,
|
||||
name));
|
||||
|
||||
|
||||
add_automation_child (*p, pan_track, show);
|
||||
}
|
||||
}
|
||||
@@ -329,7 +329,7 @@ AudioTimeAxisView::toggle_gain_track ()
|
||||
}
|
||||
|
||||
/* now trigger a redisplay */
|
||||
|
||||
|
||||
if (!no_redraw) {
|
||||
_route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */
|
||||
}
|
||||
@@ -369,7 +369,7 @@ AudioTimeAxisView::toggle_pan_track ()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
AudioTimeAxisView::show_all_automation ()
|
||||
{
|
||||
@@ -419,7 +419,7 @@ void
|
||||
AudioTimeAxisView::hide_all_xfades ()
|
||||
{
|
||||
AudioStreamView* asv = audio_view();
|
||||
|
||||
|
||||
if (asv) {
|
||||
asv->hide_all_xfades ();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2006 Paul Davis
|
||||
Copyright (C) 2000-2006 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
|
||||
@@ -68,7 +68,7 @@ class AudioTimeAxisView : public RouteTimeAxisView
|
||||
public:
|
||||
AudioTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
virtual ~AudioTimeAxisView ();
|
||||
|
||||
|
||||
AudioStreamView* audio_view();
|
||||
|
||||
void set_show_waveforms_recording (bool yn);
|
||||
@@ -76,24 +76,24 @@ class AudioTimeAxisView : public RouteTimeAxisView
|
||||
void hide_all_xfades ();
|
||||
void hide_dependent_views (TimeAxisViewItem&);
|
||||
void reveal_dependent_views (TimeAxisViewItem&);
|
||||
|
||||
|
||||
/* Overridden from parent to store display state */
|
||||
guint32 show_at (double y, int& nth, Gtk::VBox *parent);
|
||||
void hide ();
|
||||
|
||||
|
||||
void create_automation_child (const Evoral::Parameter& param, bool show);
|
||||
|
||||
|
||||
void first_idle ();
|
||||
|
||||
private:
|
||||
friend class AudioStreamView;
|
||||
friend class AudioRegionView;
|
||||
|
||||
|
||||
void route_active_changed ();
|
||||
|
||||
void append_extra_display_menu_items ();
|
||||
Gtk::Menu* build_mode_menu();
|
||||
|
||||
|
||||
void show_all_automation ();
|
||||
void show_existing_automation ();
|
||||
void hide_all_automation ();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Author: Dave Robillard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -44,16 +44,16 @@ AutomationController::AutomationController(boost::shared_ptr<AutomationControl>
|
||||
set_name (X_("PluginSlider")); // FIXME: get yer own name!
|
||||
set_style (BarController::LeftToRight);
|
||||
set_use_parent (true);
|
||||
|
||||
|
||||
StartGesture.connect (mem_fun(*this, &AutomationController::start_touch));
|
||||
StopGesture.connect (mem_fun(*this, &AutomationController::end_touch));
|
||||
|
||||
|
||||
_adjustment->signal_value_changed().connect (
|
||||
mem_fun(*this, &AutomationController::value_adjusted));
|
||||
|
||||
|
||||
_screen_update_connection = ARDOUR_UI::RapidScreenUpdate.connect (
|
||||
mem_fun (*this, &AutomationController::display_effective_value));
|
||||
|
||||
|
||||
ac->Changed.connect (mem_fun(*this, &AutomationController::value_changed));
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ AutomationController::get_label (int&)
|
||||
} else {
|
||||
s << std::fixed << std::setprecision(3) << _controllable->get_value();
|
||||
}
|
||||
|
||||
|
||||
return s.str ();
|
||||
}
|
||||
|
||||
@@ -99,9 +99,9 @@ AutomationController::display_effective_value()
|
||||
// return;
|
||||
|
||||
float value = _controllable->get_value();
|
||||
|
||||
|
||||
if (_adjustment->get_value() != value) {
|
||||
_ignore_change = true;
|
||||
_ignore_change = true;
|
||||
_adjustment->set_value (value);
|
||||
_ignore_change = false;
|
||||
}
|
||||
@@ -133,9 +133,9 @@ AutomationController::automation_state_changed ()
|
||||
ENSURE_GUI_THREAD(mem_fun(*this, &AutomationController::automation_state_changed));
|
||||
|
||||
bool x = (_controllable->automation_state() != Off);
|
||||
|
||||
|
||||
/* start watching automation so that things move */
|
||||
|
||||
|
||||
_screen_update_connection.disconnect();
|
||||
|
||||
if (x) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Author: Dave Robillard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -41,18 +41,18 @@ public:
|
||||
boost::shared_ptr<ARDOUR::AutomationControl> ac);
|
||||
|
||||
~AutomationController();
|
||||
|
||||
|
||||
boost::shared_ptr<ARDOUR::AutomationControl> controllable() { return _controllable; }
|
||||
|
||||
Gtk::Adjustment* adjustment() { return _adjustment; }
|
||||
|
||||
|
||||
void display_effective_value();
|
||||
void value_adjusted();
|
||||
|
||||
private:
|
||||
AutomationController (boost::shared_ptr<ARDOUR::AutomationControl> ac, Gtk::Adjustment* adj);
|
||||
std::string get_label (int&);
|
||||
|
||||
|
||||
void start_touch();
|
||||
void end_touch();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2002-2003 Paul Davis
|
||||
Copyright (C) 2002-2003 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
|
||||
@@ -120,7 +120,7 @@ AutomationLine::queue_reset ()
|
||||
}
|
||||
|
||||
void
|
||||
AutomationLine::show ()
|
||||
AutomationLine::show ()
|
||||
{
|
||||
if (_interpolation != AutomationList::Discrete) {
|
||||
line->show();
|
||||
@@ -136,7 +136,7 @@ AutomationLine::show ()
|
||||
}
|
||||
|
||||
void
|
||||
AutomationLine::hide ()
|
||||
AutomationLine::hide ()
|
||||
{
|
||||
line->hide();
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
@@ -157,7 +157,7 @@ AutomationLine::control_point_box_size ()
|
||||
return 8.0;
|
||||
} else if (_height > (guint32) TimeAxisView::hNormal) {
|
||||
return 6.0;
|
||||
}
|
||||
}
|
||||
return 4.0;
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
||||
/* x-coord cannot move beyond adjacent points or the start/end, and is
|
||||
already in frames. it needs to be converted to canvas units.
|
||||
*/
|
||||
|
||||
|
||||
x = trackview.editor().frame_to_unit (x);
|
||||
|
||||
/* clamp x position using view coordinates */
|
||||
@@ -280,14 +280,14 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
||||
|
||||
if (!with_push) {
|
||||
if (cp.view_index() < control_points.size() - 1) {
|
||||
|
||||
|
||||
after = nth (cp.view_index() + 1);
|
||||
|
||||
|
||||
/*if it is a "spike" leave the x alone */
|
||||
|
||||
|
||||
if (after->get_x() - before->get_x() < 2) {
|
||||
x = cp.get_x();
|
||||
|
||||
|
||||
} else {
|
||||
x = min (x, after->get_x()-1.0);
|
||||
}
|
||||
@@ -298,7 +298,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
||||
} else {
|
||||
|
||||
ControlPoint* after;
|
||||
|
||||
|
||||
/* find the first point that can't move */
|
||||
|
||||
for (uint32_t n = cp.view_index() + 1; (after = nth (n)) != 0; ++n) {
|
||||
@@ -308,10 +308,10 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
delta = x - cp.get_x();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
/* leave the x-coordinate alone */
|
||||
@@ -328,17 +328,17 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
||||
} else {
|
||||
|
||||
uint32_t limit = min (control_points.size(), (size_t)last_movable);
|
||||
|
||||
|
||||
/* move the current point to wherever the user told it to go, subject
|
||||
to x_limit.
|
||||
*/
|
||||
|
||||
|
||||
cp.move_to (min (x, x_limit), y, ControlPoint::Full);
|
||||
reset_line_coords (cp);
|
||||
|
||||
|
||||
/* now move all subsequent control points, to reflect the motion.
|
||||
*/
|
||||
|
||||
|
||||
for (uint32_t i = cp.view_index() + 1; i < limit; ++i) {
|
||||
ControlPoint *p = nth (i);
|
||||
double new_x;
|
||||
@@ -354,7 +354,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
||||
|
||||
void
|
||||
AutomationLine::reset_line_coords (ControlPoint& cp)
|
||||
{
|
||||
{
|
||||
if (cp.view_index() < line_points.size()) {
|
||||
line_points[cp.view_index()].set_x (cp.get_x());
|
||||
line_points[cp.view_index()].set_y (cp.get_y());
|
||||
@@ -381,7 +381,7 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
|
||||
initial results are in canvas units. ask the
|
||||
line to convert them to something relevant.
|
||||
*/
|
||||
|
||||
|
||||
mr.xval = cp.get_x();
|
||||
mr.yval = 1.0 - (cp.get_y() / _height);
|
||||
|
||||
@@ -395,7 +395,7 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
|
||||
|
||||
/* convert to model units
|
||||
*/
|
||||
|
||||
|
||||
view_to_model_coord (mr.xval, mr.yval);
|
||||
|
||||
/* part 2: find out where the model point is now
|
||||
@@ -451,7 +451,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
uint32_t this_rx = 0;
|
||||
uint32_t prev_rx = 0;
|
||||
uint32_t this_ry = 0;
|
||||
uint32_t prev_ry = 0;
|
||||
uint32_t prev_ry = 0;
|
||||
double* slope;
|
||||
uint32_t box_size;
|
||||
uint32_t cpsize;
|
||||
@@ -459,7 +459,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
/* hide all existing points, and the line */
|
||||
|
||||
cpsize = 0;
|
||||
|
||||
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
(*i)->hide();
|
||||
++cpsize;
|
||||
@@ -493,7 +493,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
|
||||
double tx = points[pi].x;
|
||||
double ty = points[pi].y;
|
||||
|
||||
|
||||
if (isnan (tx) || isnan (ty)) {
|
||||
warning << string_compose (_("Ignoring illegal points on AutomationLine \"%1\""),
|
||||
_name) << endmsg;
|
||||
@@ -518,11 +518,11 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
if (slope[pi] == slope[pi-1]) {
|
||||
|
||||
/* no reason to display this point */
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* need to round here. the ultimate coordinates are integer
|
||||
pixels, so tiny deltas in the coords will be eliminated
|
||||
and we end up with "colinear" line segments. since the
|
||||
@@ -532,14 +532,14 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
*/
|
||||
|
||||
this_rx = (uint32_t) rint (tx);
|
||||
this_ry = (uint32_t) rint (ty);
|
||||
|
||||
this_ry = (uint32_t) rint (ty);
|
||||
|
||||
if (view_index && pi != npoints && /* not the first, not the last */
|
||||
(((this_rx == prev_rx) && (this_ry == prev_ry)) || /* same point */
|
||||
(((this_rx - prev_rx) < (box_size + 2)) && /* not identical, but still too close horizontally */
|
||||
(abs ((int)(this_ry - prev_ry)) < (int) (box_size + 2))))) { /* too close vertically */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* ok, we should display this point */
|
||||
|
||||
@@ -548,8 +548,8 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
/* make sure we have enough control points */
|
||||
|
||||
ControlPoint* ncp = new ControlPoint (*this);
|
||||
|
||||
ncp->set_size (box_size);
|
||||
|
||||
ncp->set_size (box_size);
|
||||
|
||||
control_points.push_back (ncp);
|
||||
++cpsize;
|
||||
@@ -586,7 +586,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
prev_ry = this_ry;
|
||||
|
||||
/* finally, control visibility */
|
||||
|
||||
|
||||
if (_visible && points_visible) {
|
||||
control_points[view_index]->show ();
|
||||
control_points[view_index]->set_visible (true);
|
||||
@@ -598,7 +598,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
|
||||
view_index++;
|
||||
}
|
||||
|
||||
|
||||
/* discard extra CP's to avoid confusing ourselves */
|
||||
|
||||
while (control_points.size() > view_index) {
|
||||
@@ -616,7 +616,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
if (view_index > 1) {
|
||||
|
||||
npoints = view_index;
|
||||
|
||||
|
||||
/* reset the line coordinates */
|
||||
|
||||
while (line_points.size() < npoints) {
|
||||
@@ -631,14 +631,14 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
||||
line_points[view_index].set_x (control_points[view_index]->get_x());
|
||||
line_points[view_index].set_y (control_points[view_index]->get_y());
|
||||
}
|
||||
|
||||
|
||||
line->property_points() = line_points;
|
||||
|
||||
if (_visible && _interpolation != AutomationList::Discrete) {
|
||||
line->show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
set_selected_points (trackview.editor().get_selection().points);
|
||||
|
||||
@@ -697,7 +697,7 @@ AutomationLine::string_to_fraction (string const & s) const
|
||||
|
||||
double v;
|
||||
sscanf (s.c_str(), "%lf", &v);
|
||||
|
||||
|
||||
if (_uses_gain_mapping) {
|
||||
v = gain_to_slider_position (dB_to_coefficient (v));
|
||||
} else {
|
||||
@@ -722,7 +722,7 @@ AutomationLine::invalidate_point (ALPoints& p, uint32_t index)
|
||||
}
|
||||
|
||||
void
|
||||
AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
||||
AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
||||
{
|
||||
if (trackview.editor().current_session() == 0) { /* how? */
|
||||
return;
|
||||
@@ -738,7 +738,7 @@ AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
||||
|
||||
trackview.editor().current_session()->begin_reversible_command (str);
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
|
||||
|
||||
drag_x = x;
|
||||
drag_distance = 0;
|
||||
first_drag_fraction = fraction;
|
||||
@@ -748,7 +748,7 @@ AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
||||
}
|
||||
|
||||
void
|
||||
AutomationLine::point_drag (ControlPoint& cp, nframes_t x, float fraction, bool with_push)
|
||||
AutomationLine::point_drag (ControlPoint& cp, nframes_t x, float fraction, bool with_push)
|
||||
{
|
||||
if (x > drag_x) {
|
||||
drag_distance += (x - drag_x);
|
||||
@@ -769,17 +769,17 @@ AutomationLine::point_drag (ControlPoint& cp, nframes_t x, float fraction, bool
|
||||
}
|
||||
|
||||
void
|
||||
AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_push)
|
||||
AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_push)
|
||||
{
|
||||
double ydelta = fraction - last_drag_fraction;
|
||||
|
||||
did_push = with_push;
|
||||
|
||||
|
||||
last_drag_fraction = fraction;
|
||||
|
||||
line_drag_cp1 = i1;
|
||||
line_drag_cp2 = i2;
|
||||
|
||||
|
||||
//check if one of the control points on the line is in a selected range
|
||||
bool range_found = false;
|
||||
ControlPoint *cp;
|
||||
@@ -804,7 +804,7 @@ AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_p
|
||||
modify_view_point (*cp, trackview.editor().unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (line_points.size() > 1) {
|
||||
line->property_points() = line_points;
|
||||
}
|
||||
@@ -813,7 +813,7 @@ AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_p
|
||||
}
|
||||
|
||||
void
|
||||
AutomationLine::end_drag (ControlPoint* cp)
|
||||
AutomationLine::end_drag (ControlPoint* cp)
|
||||
{
|
||||
if (!drags) {
|
||||
return;
|
||||
@@ -826,7 +826,7 @@ AutomationLine::end_drag (ControlPoint* cp)
|
||||
} else {
|
||||
sync_model_with_view_line (line_drag_cp1, line_drag_cp2);
|
||||
}
|
||||
|
||||
|
||||
alist->thaw ();
|
||||
|
||||
update_pending = false;
|
||||
@@ -845,7 +845,7 @@ AutomationLine::sync_model_with_view_point (ControlPoint& cp, bool did_push, int
|
||||
|
||||
model_representation (cp, mr);
|
||||
|
||||
/* how much are we changing the central point by */
|
||||
/* how much are we changing the central point by */
|
||||
|
||||
ydelta = mr.yval - mr.ypos;
|
||||
|
||||
@@ -858,13 +858,13 @@ AutomationLine::sync_model_with_view_point (ControlPoint& cp, bool did_push, int
|
||||
/* change all points before the primary point */
|
||||
|
||||
for (AutomationList::iterator i = mr.start; i != cp.model(); ++i) {
|
||||
|
||||
|
||||
double fract = ((*i)->when - mr.xmin) / (mr.xpos - mr.xmin);
|
||||
double y_delta = ydelta * fract;
|
||||
double x_delta = distance * fract;
|
||||
|
||||
/* interpolate */
|
||||
|
||||
|
||||
if (y_delta || x_delta) {
|
||||
alist->modify (i, (*i)->when + x_delta, mr.ymin + y_delta);
|
||||
}
|
||||
@@ -877,24 +877,24 @@ AutomationLine::sync_model_with_view_point (ControlPoint& cp, bool did_push, int
|
||||
|
||||
|
||||
/* change later points */
|
||||
|
||||
|
||||
AutomationList::iterator i = cp.model();
|
||||
|
||||
|
||||
++i;
|
||||
|
||||
|
||||
while (i != mr.end) {
|
||||
|
||||
|
||||
double delta = ydelta * (mr.xmax - (*i)->when) / (mr.xmax - mr.xpos);
|
||||
|
||||
/* all later points move by the same distance along the x-axis as the main point */
|
||||
|
||||
|
||||
if (delta) {
|
||||
alist->modify (i, (*i)->when + distance, (*i)->value + delta);
|
||||
}
|
||||
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
|
||||
if (did_push) {
|
||||
|
||||
/* move all points after the range represented by the view by the same distance
|
||||
@@ -906,7 +906,7 @@ AutomationLine::sync_model_with_view_point (ControlPoint& cp, bool did_push, int
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
bool
|
||||
AutomationLine::control_points_adjacent (double xval, uint32_t & before, uint32_t& after)
|
||||
{
|
||||
ControlPoint *bcp = 0;
|
||||
@@ -916,13 +916,13 @@ AutomationLine::control_points_adjacent (double xval, uint32_t & before, uint32_
|
||||
unit_xval = trackview.editor().frame_to_unit (xval);
|
||||
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
|
||||
|
||||
if ((*i)->get_x() <= unit_xval) {
|
||||
|
||||
if (!bcp || (*i)->get_x() > bcp->get_x()) {
|
||||
bcp = *i;
|
||||
before = bcp->view_index();
|
||||
}
|
||||
}
|
||||
|
||||
} else if ((*i)->get_x() > unit_xval) {
|
||||
acp = *i;
|
||||
@@ -946,7 +946,7 @@ AutomationLine::is_last_point (ControlPoint& cp)
|
||||
if (!alist->empty() && mr.end == alist->end()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -962,7 +962,7 @@ AutomationLine::is_first_point (ControlPoint& cp)
|
||||
if (!alist->empty() && mr.start == alist->begin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -997,10 +997,10 @@ AutomationLine::get_selectables (nframes_t& start, nframes_t& end,
|
||||
bool collecting = false;
|
||||
|
||||
/* Curse X11 and its inverted coordinate system! */
|
||||
|
||||
|
||||
bot = (1.0 - topfrac) * _height;
|
||||
top = (1.0 - botfrac) * _height;
|
||||
|
||||
|
||||
nstart = max_frames;
|
||||
nend = 0;
|
||||
|
||||
@@ -1008,7 +1008,7 @@ AutomationLine::get_selectables (nframes_t& start, nframes_t& end,
|
||||
double when = (*(*i)->model())->when;
|
||||
|
||||
if (when >= start && when <= end) {
|
||||
|
||||
|
||||
if ((*i)->get_y() >= bot && (*i)->get_y() <= top) {
|
||||
|
||||
(*i)->show();
|
||||
@@ -1018,7 +1018,7 @@ AutomationLine::get_selectables (nframes_t& start, nframes_t& end,
|
||||
nend = max (nend, when);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if (collecting) {
|
||||
|
||||
results.push_back (new AutomationSelectable (nstart, nend, botfrac, topfrac, trackview));
|
||||
@@ -1054,10 +1054,10 @@ AutomationLine::set_selected_points (PointSelection& points)
|
||||
|
||||
if (points.empty()) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (PointSelection::iterator r = points.begin(); r != points.end(); ++r) {
|
||||
|
||||
|
||||
if (&(*r).track != &trackview) {
|
||||
continue;
|
||||
}
|
||||
@@ -1068,16 +1068,16 @@ AutomationLine::set_selected_points (PointSelection& points)
|
||||
top = (1.0 - (*r).low_fract) * _height;
|
||||
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
|
||||
|
||||
double rstart, rend;
|
||||
|
||||
|
||||
rstart = trackview.editor().frame_to_unit ((*r).start);
|
||||
rend = trackview.editor().frame_to_unit ((*r).end);
|
||||
|
||||
|
||||
if ((*i)->get_x() >= rstart && (*i)->get_x() <= rend) {
|
||||
|
||||
|
||||
if ((*i)->get_y() >= bot && (*i)->get_y() <= top) {
|
||||
|
||||
|
||||
(*i)->set_selected(true);
|
||||
}
|
||||
}
|
||||
@@ -1105,21 +1105,21 @@ AutomationLine::show_selection ()
|
||||
TimeSelection& time (trackview.editor().get_selection().time);
|
||||
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
|
||||
|
||||
(*i)->set_selected(false);
|
||||
|
||||
for (list<AudioRange>::iterator r = time.begin(); r != time.end(); ++r) {
|
||||
double rstart, rend;
|
||||
|
||||
|
||||
rstart = trackview.editor().frame_to_unit ((*r).start);
|
||||
rend = trackview.editor().frame_to_unit ((*r).end);
|
||||
|
||||
|
||||
if ((*i)->get_x() >= rstart && (*i)->get_x() <= rend) {
|
||||
(*i)->set_selected(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(*i)->show_color (false, !points_visible);
|
||||
}
|
||||
}
|
||||
@@ -1154,14 +1154,14 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
|
||||
AutomationList::const_iterator ai;
|
||||
|
||||
for (ai = events.begin(); ai != events.end(); ++ai) {
|
||||
|
||||
|
||||
double translated_x = (*ai)->when;
|
||||
double translated_y = (*ai)->value;
|
||||
model_to_view_coord (translated_x, translated_y);
|
||||
|
||||
add_model_point (tmp_points, (*ai)->when, translated_y);
|
||||
}
|
||||
|
||||
|
||||
determine_visible_control_points (tmp_points);
|
||||
}
|
||||
|
||||
@@ -1236,7 +1236,7 @@ AutomationLine::hide_all_but_selected_control_points ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AutomationLine::track_entered()
|
||||
{
|
||||
@@ -1260,7 +1260,7 @@ AutomationLine::get_state (void)
|
||||
return alist->get_state();
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
AutomationLine::set_state (const XMLNode &node)
|
||||
{
|
||||
/* function as a proxy for the model */
|
||||
@@ -1303,11 +1303,11 @@ AutomationLine::model_to_view_coord (double& x, double& y) const
|
||||
} else {
|
||||
y = y / (double)alist->parameter().max(); /* ... like this */
|
||||
}
|
||||
|
||||
|
||||
x = _time_converter.to(x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
AutomationLine::set_interpolation(AutomationList::InterpolationStyle style)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2002 Paul Davis
|
||||
Copyright (C) 2002 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
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "evoral/TimeConverter.hpp"
|
||||
|
||||
#include "pbd/undo.h"
|
||||
#include "pbd/statefuldestructible.h"
|
||||
#include "pbd/statefuldestructible.h"
|
||||
|
||||
#include "ardour/automation_list.h"
|
||||
#include "ardour/types.h"
|
||||
@@ -66,13 +66,13 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
|
||||
|
||||
void set_selected_points (PointSelection&);
|
||||
void get_selectables (nframes_t& start, nframes_t& end,
|
||||
double botfrac, double topfrac,
|
||||
double botfrac, double topfrac,
|
||||
std::list<Selectable*>& results);
|
||||
void get_inverted_selectables (Selection&, std::list<Selectable*>& results);
|
||||
|
||||
virtual void remove_point (ControlPoint&);
|
||||
bool control_points_adjacent (double xval, uint32_t& before, uint32_t& after);
|
||||
|
||||
|
||||
/* dragging API */
|
||||
virtual void start_drag (ControlPoint*, nframes_t x, float fraction);
|
||||
virtual void point_drag(ControlPoint&, nframes_t x, float, bool with_push);
|
||||
@@ -129,13 +129,13 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
|
||||
void set_colors();
|
||||
|
||||
void modify_point_y (ControlPoint&, double);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
std::string _name;
|
||||
guint32 _height;
|
||||
uint32_t _line_color;
|
||||
|
||||
|
||||
boost::shared_ptr<ARDOUR::AutomationList> alist;
|
||||
|
||||
bool _visible : 1;
|
||||
@@ -162,11 +162,11 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
|
||||
|
||||
static void invalidate_point (ALPoints&, uint32_t index);
|
||||
static bool invalid_point (ALPoints&, uint32_t index);
|
||||
|
||||
|
||||
void determine_visible_control_points (ALPoints&);
|
||||
void sync_model_with_view_point (ControlPoint&, bool did_push, int64_t distance);
|
||||
void sync_model_with_view_line (uint32_t, uint32_t);
|
||||
|
||||
|
||||
virtual void change_model (ARDOUR::AutomationList::iterator, double x, double y);
|
||||
|
||||
void reset_callback (const Evoral::ControlList&);
|
||||
@@ -174,7 +174,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
|
||||
|
||||
virtual bool event_handler (GdkEvent*);
|
||||
virtual void add_model_point (ALPoints& tmp_points, double frame, double yfract);
|
||||
|
||||
|
||||
private:
|
||||
uint32_t drags;
|
||||
double first_drag_fraction;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Author: Dave Robillard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -36,12 +36,12 @@ AutomationRegionView::AutomationRegionView(ArdourCanvas::Group*
|
||||
Gdk::Color const & basic_color)
|
||||
: RegionView(parent, time_axis, region, spu, basic_color)
|
||||
, _parameter(param)
|
||||
{
|
||||
{
|
||||
if (list) {
|
||||
assert(list->parameter() == param);
|
||||
create_line(list);
|
||||
}
|
||||
|
||||
|
||||
group->signal_event().connect (mem_fun (this, &AutomationRegionView::canvas_event), false);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void
|
||||
AutomationRegionView::init (Gdk::Color const & basic_color, bool /*wfd*/)
|
||||
{
|
||||
_enable_display = false;
|
||||
|
||||
|
||||
RegionView::init(basic_color, false);
|
||||
|
||||
compute_colors (basic_color);
|
||||
@@ -149,7 +149,7 @@ void
|
||||
AutomationRegionView::reset_width_dependent_items (double pixel_width)
|
||||
{
|
||||
RegionView::reset_width_dependent_items(pixel_width);
|
||||
|
||||
|
||||
if (_line)
|
||||
_line->reset();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Author: Dave Robillard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -48,18 +48,18 @@ public:
|
||||
Gdk::Color const & basic_color);
|
||||
|
||||
~AutomationRegionView() {}
|
||||
|
||||
|
||||
void init (Gdk::Color const & basic_color, bool wfd);
|
||||
|
||||
|
||||
inline AutomationTimeAxisView* automation_view() const
|
||||
{ return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
|
||||
|
||||
|
||||
void set_line(boost::shared_ptr<AutomationLine> line) { _line = line; }
|
||||
boost::shared_ptr<AutomationLine> line() { return _line; }
|
||||
|
||||
|
||||
// We are a ghost. Meta ghosts? Crazy talk.
|
||||
virtual GhostRegion* add_ghost(TimeAxisView&) { return NULL; }
|
||||
|
||||
|
||||
void set_height (double);
|
||||
void reset_width_dependent_items(double pixel_width);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001-2007 Paul Davis
|
||||
Copyright (C) 2001-2007 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
|
||||
@@ -98,7 +98,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
|
||||
|
||||
for (i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
if ((*i)->region() == region) {
|
||||
|
||||
|
||||
/* great. we already have an AutomationRegionView for this Region. use it again. */
|
||||
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*>(*i);;
|
||||
|
||||
@@ -111,14 +111,14 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
region_view = new AutomationRegionView (canvas_group, _automation_view, region,
|
||||
_controller->controllable()->parameter(), list,
|
||||
_samples_per_unit, region_color);
|
||||
|
||||
|
||||
region_view->init (region_color, false);
|
||||
region_views.push_front (region_view);
|
||||
|
||||
|
||||
/* follow global waveform setting */
|
||||
|
||||
if (wfd) {
|
||||
@@ -130,7 +130,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
|
||||
|
||||
/* catch regionview going away */
|
||||
region->GoingAway.connect (bind (mem_fun (*this, &AutomationStreamView::remove_region_view), region));
|
||||
|
||||
|
||||
RegionViewAdded (region_view);
|
||||
|
||||
return region_view;
|
||||
@@ -170,7 +170,7 @@ AutomationStreamView::redisplay_diskstream ()
|
||||
sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Stack regions by layer, and remove invalid regions
|
||||
layer_regions();
|
||||
}
|
||||
@@ -190,9 +190,9 @@ void
|
||||
AutomationStreamView::rec_data_range_ready (jack_nframes_t start, jack_nframes_t dur)
|
||||
{
|
||||
// this is called from the butler thread for now
|
||||
|
||||
|
||||
ENSURE_GUI_THREAD(bind (mem_fun (*this, &AutomationStreamView::rec_data_range_ready), start, dur));
|
||||
|
||||
|
||||
this->update_rec_regions (start, dur);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ AutomationStreamView::color_handler ()
|
||||
{
|
||||
/*if (_trackview.is_midi_track()) {
|
||||
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiTrackBase.get();
|
||||
}
|
||||
}
|
||||
|
||||
if (!_trackview.is_midi_track()) {
|
||||
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiBusBase.get();;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001, 2007 Paul Davis
|
||||
Copyright (C) 2001, 2007 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
|
||||
@@ -48,23 +48,23 @@ class AutomationStreamView : public StreamView
|
||||
void set_automation_state (ARDOUR::AutoState state);
|
||||
|
||||
void redisplay_diskstream ();
|
||||
|
||||
inline double contents_height() const {
|
||||
|
||||
inline double contents_height() const {
|
||||
return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void setup_rec_box ();
|
||||
void rec_data_range_ready (jack_nframes_t start, jack_nframes_t dur);
|
||||
void rec_data_range_ready (jack_nframes_t start, jack_nframes_t dur);
|
||||
void update_rec_regions (jack_nframes_t start, jack_nframes_t dur);
|
||||
|
||||
|
||||
RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_data, bool recording = false);
|
||||
void display_region(AutomationRegionView* region_view);
|
||||
|
||||
|
||||
void color_handler ();
|
||||
|
||||
|
||||
boost::shared_ptr<AutomationController> _controller;
|
||||
|
||||
|
||||
AutomationTimeAxisView& _automation_view;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -61,7 +61,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
||||
boost::shared_ptr<Automatable> a, boost::shared_ptr<AutomationControl> c,
|
||||
PublicEditor& e, TimeAxisView& parent, bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas, const string & nom, const string & nomparent)
|
||||
: AxisView (s),
|
||||
: AxisView (s),
|
||||
TimeAxisView (s, e, &parent, canvas),
|
||||
_route (r),
|
||||
_control (c),
|
||||
@@ -87,17 +87,17 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
||||
|
||||
ignore_state_request = false;
|
||||
first_call_to_set_height = true;
|
||||
|
||||
|
||||
_base_rect = new SimpleRect(*_canvas_display);
|
||||
_base_rect->property_x1() = 0.0;
|
||||
_base_rect->property_y1() = 0.0;
|
||||
_base_rect->property_x2() = LONG_MAX - 2;
|
||||
_base_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_AutomationTrackOutline.get();
|
||||
|
||||
|
||||
/* outline ends and bottom */
|
||||
_base_rect->property_outline_what() = (guint32) (0x1|0x2|0x8);
|
||||
_base_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_AutomationTrackFill.get();
|
||||
|
||||
|
||||
_base_rect->set_data ("trackview", this);
|
||||
|
||||
_base_rect->signal_event().connect (bind (
|
||||
@@ -172,12 +172,12 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
||||
tipname += _name;
|
||||
ARDOUR_UI::instance()->tooltips().set_tip(controls_ebox, tipname);
|
||||
}
|
||||
|
||||
|
||||
/* add the buttons */
|
||||
controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
|
||||
controls_table.attach (auto_button, 5, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
|
||||
|
||||
/* add bar controller */
|
||||
controls_table.attach (*_controller.get(), 0, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
|
||||
@@ -195,14 +195,14 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
||||
|
||||
if (xml_node) {
|
||||
set_state (*xml_node);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ask for notifications of any new RegionViews */
|
||||
if (show_regions) {
|
||||
|
||||
assert(_view);
|
||||
_view->attach ();
|
||||
|
||||
|
||||
/* no regions, just a single line for the entire track (e.g. bus gain) */
|
||||
} else {
|
||||
boost::shared_ptr<AutomationLine> line(new AutomationLine (
|
||||
@@ -281,7 +281,7 @@ AutomationTimeAxisView::automation_state_changed ()
|
||||
} else {
|
||||
state = _control->alist()->automation_state ();
|
||||
}
|
||||
|
||||
|
||||
switch (state & (Off|Play|Touch|Write)) {
|
||||
case Off:
|
||||
auto_button.set_label (_("Manual"));
|
||||
@@ -335,9 +335,9 @@ AutomationTimeAxisView::automation_state_changed ()
|
||||
|
||||
void
|
||||
AutomationTimeAxisView::interpolation_changed ()
|
||||
{
|
||||
{
|
||||
AutomationList::InterpolationStyle style = _control->list()->interpolation();
|
||||
|
||||
|
||||
if (mode_line_item && mode_discrete_item) {
|
||||
if (style == AutomationList::Discrete) {
|
||||
mode_discrete_item->set_active(true);
|
||||
@@ -347,7 +347,7 @@ AutomationTimeAxisView::interpolation_changed ()
|
||||
mode_discrete_item->set_active(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (_line) {
|
||||
_line->set_interpolation(style);
|
||||
}
|
||||
@@ -376,7 +376,7 @@ void
|
||||
AutomationTimeAxisView::set_height (uint32_t h)
|
||||
{
|
||||
bool changed = (height != (uint32_t) h) || first_call_to_set_height;
|
||||
bool changed_between_small_and_normal = (
|
||||
bool changed_between_small_and_normal = (
|
||||
(height < hNormal && h >= hNormal)
|
||||
|| (height >= hNormal || h < hNormal) );
|
||||
|
||||
@@ -386,10 +386,10 @@ AutomationTimeAxisView::set_height (uint32_t h)
|
||||
|
||||
TimeAxisView::set_height (h);
|
||||
_base_rect->property_y2() = h;
|
||||
|
||||
|
||||
if (_line)
|
||||
_line->set_height(h);
|
||||
|
||||
|
||||
if (_view) {
|
||||
_view->set_height(h);
|
||||
_view->update_contents_height();
|
||||
@@ -407,7 +407,7 @@ AutomationTimeAxisView::set_height (uint32_t h)
|
||||
|
||||
if (h >= hNormal) {
|
||||
controls_table.remove (name_hbox);
|
||||
|
||||
|
||||
if (plugname) {
|
||||
if (plugname_packed) {
|
||||
controls_table.remove (*plugname);
|
||||
@@ -422,7 +422,7 @@ AutomationTimeAxisView::set_height (uint32_t h)
|
||||
hide_name_entry ();
|
||||
show_name_label ();
|
||||
name_hbox.show_all ();
|
||||
|
||||
|
||||
auto_button.show();
|
||||
hide_button.show_all();
|
||||
|
||||
@@ -439,7 +439,7 @@ AutomationTimeAxisView::set_height (uint32_t h)
|
||||
hide_name_entry ();
|
||||
show_name_label ();
|
||||
name_hbox.show_all ();
|
||||
|
||||
|
||||
auto_button.hide();
|
||||
hide_button.hide();
|
||||
}
|
||||
@@ -460,20 +460,20 @@ AutomationTimeAxisView::set_samples_per_unit (double spu)
|
||||
|
||||
if (_line)
|
||||
_line->reset ();
|
||||
|
||||
|
||||
if (_view)
|
||||
_view->set_samples_per_unit (spu);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AutomationTimeAxisView::hide_clicked ()
|
||||
{
|
||||
// LAME fix for refreshing the hide button
|
||||
hide_button.set_sensitive(false);
|
||||
|
||||
|
||||
set_marked_for_display (false);
|
||||
hide ();
|
||||
|
||||
|
||||
hide_button.set_sensitive(true);
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ AutomationTimeAxisView::build_display_menu ()
|
||||
Menu* auto_state_menu = manage (new Menu);
|
||||
auto_state_menu->set_name ("ArdourContextMenu");
|
||||
MenuList& as_items = auto_state_menu->items();
|
||||
|
||||
|
||||
as_items.push_back (CheckMenuElem (_("Manual"), bind (
|
||||
mem_fun(*this, &AutomationTimeAxisView::set_automation_state),
|
||||
(AutoState) Off)));
|
||||
@@ -528,17 +528,17 @@ AutomationTimeAxisView::build_display_menu ()
|
||||
auto_touch_item = dynamic_cast<CheckMenuItem*>(&as_items.back());
|
||||
|
||||
items.push_back (MenuElem (_("State"), *auto_state_menu));
|
||||
|
||||
|
||||
/* mode menu */
|
||||
|
||||
if ( EventTypeMap::instance().is_midi_parameter(_control->parameter()) ) {
|
||||
|
||||
|
||||
Menu* auto_mode_menu = manage (new Menu);
|
||||
auto_mode_menu->set_name ("ArdourContextMenu");
|
||||
MenuList& am_items = auto_mode_menu->items();
|
||||
|
||||
|
||||
RadioMenuItem::Group group;
|
||||
|
||||
|
||||
am_items.push_back (RadioMenuElem (group, _("Discrete"), bind (
|
||||
mem_fun(*this, &AutomationTimeAxisView::set_interpolation),
|
||||
AutomationList::Discrete)));
|
||||
@@ -661,7 +661,7 @@ AutomationTimeAxisView::reset_objects_one (AutomationLine& line, PointSelection&
|
||||
if (&(*i).track != this) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
alist->reset_range ((*i).start, (*i).end);
|
||||
}
|
||||
}
|
||||
@@ -700,7 +700,7 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
|
||||
_editor.get_cut_buffer().add (what_we_got);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case Clear:
|
||||
if ((what_we_got = alist->cut ((*i).start, (*i).end)) != 0) {
|
||||
_session.add_command (new MementoCommand<AutomationList>(*alist.get(), new XMLNode (before), &alist->get_state()));
|
||||
@@ -736,7 +736,7 @@ AutomationTimeAxisView::paste_one (AutomationLine& line, nframes_t pos, float ti
|
||||
{
|
||||
AutomationSelection::iterator p;
|
||||
boost::shared_ptr<AutomationList> alist(line.the_list());
|
||||
|
||||
|
||||
for (p = selection.lines.begin(); p != selection.lines.end() && nth; ++p, --nth) {}
|
||||
|
||||
if (p == selection.lines.end()) {
|
||||
@@ -747,7 +747,7 @@ AutomationTimeAxisView::paste_one (AutomationLine& line, nframes_t pos, float ti
|
||||
values from view coordinates to model coordinates, and we're
|
||||
not supposed to modify the points in the selection.
|
||||
*/
|
||||
|
||||
|
||||
AutomationList copy (**p);
|
||||
|
||||
for (AutomationList::iterator x = copy.begin(); x != copy.end(); ++x) {
|
||||
@@ -857,7 +857,7 @@ AutomationTimeAxisView::exited ()
|
||||
}
|
||||
|
||||
void
|
||||
AutomationTimeAxisView::color_handler ()
|
||||
AutomationTimeAxisView::color_handler ()
|
||||
{
|
||||
if (_line) {
|
||||
_line->set_colors();
|
||||
@@ -877,7 +877,7 @@ AutomationTimeAxisView::set_state (const XMLNode& node)
|
||||
_canvas_display->show (); /* FIXME: necessary? show_at? */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!_marked_for_display) {
|
||||
hide();
|
||||
}
|
||||
@@ -910,7 +910,7 @@ guint32
|
||||
AutomationTimeAxisView::show_at (double y, int& nth, Gtk::VBox *parent)
|
||||
{
|
||||
update_extra_xml_shown (true);
|
||||
|
||||
|
||||
return TimeAxisView::show_at (y, nth, parent);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -66,7 +66,7 @@ class AutomationTimeAxisView : public TimeAxisView {
|
||||
const std::string & plug_name = "");
|
||||
|
||||
~AutomationTimeAxisView();
|
||||
|
||||
|
||||
virtual void set_height (uint32_t);
|
||||
void set_samples_per_unit (double);
|
||||
std::string name() const { return _name; }
|
||||
@@ -84,20 +84,20 @@ class AutomationTimeAxisView : public TimeAxisView {
|
||||
void hide_timestretch () {}
|
||||
|
||||
/* editing operations */
|
||||
|
||||
|
||||
bool cut_copy_clear (Selection&, Editing::CutCopyOp);
|
||||
bool cut_copy_clear_objects (PointSelection&, Editing::CutCopyOp);
|
||||
bool paste (nframes_t, float times, Selection&, size_t nth);
|
||||
void reset_objects (PointSelection&);
|
||||
|
||||
int set_state (const XMLNode&);
|
||||
|
||||
|
||||
guint32 show_at (double y, int& nth, Gtk::VBox *parent);
|
||||
void hide ();
|
||||
|
||||
|
||||
static const std::string state_node_name;
|
||||
XMLNode* get_state_node();
|
||||
|
||||
|
||||
boost::shared_ptr<ARDOUR::AutomationControl> control() { return _control; }
|
||||
boost::shared_ptr<AutomationController> controller() { return _controller; }
|
||||
|
||||
@@ -105,20 +105,20 @@ class AutomationTimeAxisView : public TimeAxisView {
|
||||
boost::shared_ptr<ARDOUR::Route> _route; ///< Parent route
|
||||
boost::shared_ptr<ARDOUR::AutomationControl> _control; ///< Control
|
||||
boost::shared_ptr<ARDOUR::Automatable> _automatable; ///< Control owner, maybe = _route
|
||||
|
||||
|
||||
boost::shared_ptr<AutomationController> _controller;
|
||||
|
||||
|
||||
ArdourCanvas::SimpleRect* _base_rect;
|
||||
boost::shared_ptr<AutomationLine> _line;
|
||||
AutomationStreamView* _view;
|
||||
|
||||
|
||||
std::string _name;
|
||||
bool ignore_toggle;
|
||||
|
||||
bool first_call_to_set_height;
|
||||
|
||||
Gtk::Button hide_button;
|
||||
Gtk::Button auto_button;
|
||||
Gtk::Button auto_button;
|
||||
Gtk::Menu* automation_menu;
|
||||
Gtk::Label* plugname;
|
||||
bool plugname_packed;
|
||||
@@ -132,7 +132,7 @@ class AutomationTimeAxisView : public TimeAxisView {
|
||||
Gtk::CheckMenuItem* mode_line_item;
|
||||
|
||||
void add_line (boost::shared_ptr<AutomationLine>);
|
||||
|
||||
|
||||
void clear_clicked ();
|
||||
void hide_clicked ();
|
||||
void auto_clicked ();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2003 Paul Davis
|
||||
Copyright (C) 2003 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
|
||||
@@ -59,7 +59,7 @@ Gdk::Color
|
||||
AxisView::unique_random_color()
|
||||
{
|
||||
Gdk::Color newcolor;
|
||||
|
||||
|
||||
while (1) {
|
||||
|
||||
/* avoid neon/glowing tones by limiting them to the
|
||||
@@ -76,11 +76,11 @@ AxisView::unique_random_color()
|
||||
used_colors.push_back (newcolor);
|
||||
return newcolor;
|
||||
}
|
||||
|
||||
|
||||
for (list<Gdk::Color>::iterator i = used_colors.begin(); i != used_colors.end(); ++i) {
|
||||
Gdk::Color c = *i;
|
||||
float rdelta, bdelta, gdelta;
|
||||
|
||||
|
||||
rdelta = newcolor.get_red() - c.get_red();
|
||||
bdelta = newcolor.get_blue() - c.get_blue();
|
||||
gdelta = newcolor.get_green() - c.get_green();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2003 Paul Davis
|
||||
Copyright (C) 2003 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
|
||||
@@ -55,7 +55,7 @@ class AxisView : public virtual Selectable
|
||||
virtual void set_marked_for_display (bool yn) {
|
||||
_marked_for_display = yn;
|
||||
}
|
||||
|
||||
|
||||
sigc::signal<void> Hiding;
|
||||
sigc::signal<void> GoingAway;
|
||||
|
||||
@@ -66,7 +66,7 @@ class AxisView : public virtual Selectable
|
||||
|
||||
AxisView (ARDOUR::Session& sess);
|
||||
virtual ~AxisView();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generate a new random TrackView color, unique from those colors already used.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 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
|
||||
@@ -98,21 +98,21 @@ void
|
||||
BundleEditorMatrix::add_channel (boost::shared_ptr<Bundle> b)
|
||||
{
|
||||
if (b == _bundle) {
|
||||
|
||||
|
||||
NameChannelDialog d;
|
||||
d.set_position (Gtk::WIN_POS_MOUSE);
|
||||
|
||||
|
||||
if (d.run () != Gtk::RESPONSE_ACCEPT) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_bundle->add_channel (d.get_name());
|
||||
setup_ports (OURS);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
PortMatrix::add_channel (b);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ BundleEditor::BundleEditor (Session& session, boost::shared_ptr<UserBundle> bund
|
||||
t->attach (*Gtk::manage (a), 1, 2, 1, 2);
|
||||
_input_or_output.append_text (_("Input"));
|
||||
_input_or_output.append_text (_("Output"));
|
||||
|
||||
|
||||
if (bundle->ports_are_inputs()) {
|
||||
_input_or_output.set_active_text (_("Input"));
|
||||
} else {
|
||||
@@ -201,10 +201,10 @@ BundleEditor::BundleEditor (Session& session, boost::shared_ptr<UserBundle> bund
|
||||
a = new Gtk::Alignment (0, 0.5, 0, 1);
|
||||
a->add (_type);
|
||||
t->attach (*Gtk::manage (a), 1, 2, 2, 3);
|
||||
|
||||
|
||||
_type.append_text (_("Audio"));
|
||||
_type.append_text (_("MIDI"));
|
||||
|
||||
|
||||
switch (bundle->type ()) {
|
||||
case DataType::AUDIO:
|
||||
_type.set_active_text (_("Audio"));
|
||||
@@ -215,7 +215,7 @@ BundleEditor::BundleEditor (Session& session, boost::shared_ptr<UserBundle> bund
|
||||
}
|
||||
|
||||
_type.signal_changed().connect (sigc::mem_fun (*this, &BundleEditor::type_changed));
|
||||
|
||||
|
||||
get_vbox()->pack_start (*Gtk::manage (t), false, false);
|
||||
get_vbox()->pack_start (_matrix);
|
||||
get_vbox()->set_spacing (4);
|
||||
@@ -226,7 +226,7 @@ BundleEditor::BundleEditor (Session& session, boost::shared_ptr<UserBundle> bund
|
||||
} else {
|
||||
add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_ACCEPT);
|
||||
}
|
||||
|
||||
|
||||
show_all ();
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ void
|
||||
BundleEditor::input_or_output_changed ()
|
||||
{
|
||||
_bundle->remove_ports_from_channels ();
|
||||
|
||||
|
||||
if (_input_or_output.get_active_text() == _("Output")) {
|
||||
_bundle->set_ports_are_outputs ();
|
||||
} else {
|
||||
@@ -262,7 +262,7 @@ void
|
||||
BundleEditor::type_changed ()
|
||||
{
|
||||
_bundle->remove_ports_from_channels ();
|
||||
|
||||
|
||||
DataType const t = _type.get_active_text() == _("Audio") ?
|
||||
DataType::AUDIO : DataType::MIDI;
|
||||
|
||||
@@ -290,7 +290,7 @@ BundleManager::BundleManager (Session& session)
|
||||
for (BundleList::iterator i = bundles->begin(); i != bundles->end(); ++i) {
|
||||
add_bundle (*i);
|
||||
}
|
||||
|
||||
|
||||
/* New / Edit / Delete buttons */
|
||||
Gtk::VBox* buttons = new Gtk::VBox;
|
||||
buttons->set_spacing (8);
|
||||
@@ -304,7 +304,7 @@ BundleManager::BundleManager (Session& session)
|
||||
delete_button.set_image (*Gtk::manage (new Gtk::Image (Gtk::Stock::DELETE, Gtk::ICON_SIZE_BUTTON)));
|
||||
delete_button.signal_clicked().connect (sigc::mem_fun (*this, &BundleManager::delete_clicked));
|
||||
buttons->pack_start (delete_button, false, false);
|
||||
|
||||
|
||||
Gtk::HBox* h = new Gtk::HBox;
|
||||
h->set_spacing (8);
|
||||
h->set_border_width (8);
|
||||
@@ -395,7 +395,7 @@ BundleManager::bundle_changed (Bundle::Change c, boost::shared_ptr<UserBundle> b
|
||||
if ((c & Bundle::NameChanged) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Gtk::TreeModel::iterator i = _list_model->children().begin ();
|
||||
while (i != _list_model->children().end()) {
|
||||
boost::shared_ptr<UserBundle> t = (*i)[_list_model_columns.bundle];
|
||||
@@ -430,7 +430,7 @@ NameChannelDialog::NameChannelDialog (boost::shared_ptr<Bundle> b, uint32_t c)
|
||||
|
||||
void
|
||||
NameChannelDialog::setup ()
|
||||
{
|
||||
{
|
||||
Gtk::HBox* box = Gtk::manage (new Gtk::HBox ());
|
||||
|
||||
box->pack_start (*Gtk::manage (new Gtk::Label (_("Name"))));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 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
|
||||
@@ -41,7 +41,7 @@ class BundleEditorMatrix : public PortMatrix
|
||||
PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
|
||||
|
||||
bool can_add_channel (boost::shared_ptr<ARDOUR::Bundle>) const;
|
||||
|
||||
|
||||
void add_channel (boost::shared_ptr<ARDOUR::Bundle>);
|
||||
bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
|
||||
void remove_channel (ARDOUR::BundleChannel);
|
||||
@@ -59,7 +59,7 @@ class BundleEditorMatrix : public PortMatrix
|
||||
OTHER = 0,
|
||||
OURS = 1
|
||||
};
|
||||
|
||||
|
||||
boost::shared_ptr<PortGroup> _port_group;
|
||||
boost::shared_ptr<ARDOUR::Bundle> _bundle;
|
||||
};
|
||||
@@ -77,7 +77,7 @@ class BundleEditor : public ArdourDialog
|
||||
void input_or_output_changed ();
|
||||
void type_changed ();
|
||||
void on_show ();
|
||||
|
||||
|
||||
BundleEditorMatrix _matrix;
|
||||
boost::shared_ptr<ARDOUR::UserBundle> _bundle;
|
||||
Gtk::Entry _name;
|
||||
@@ -106,11 +106,11 @@ class BundleManager : public ArdourDialog
|
||||
add (name);
|
||||
add (bundle);
|
||||
}
|
||||
|
||||
|
||||
Gtk::TreeModelColumn<Glib::ustring> name;
|
||||
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::UserBundle> > bundle;
|
||||
};
|
||||
|
||||
|
||||
Gtk::TreeView _tree_view;
|
||||
Glib::RefPtr<Gtk::ListStore> _list_model;
|
||||
ModelColumns _list_model_columns;
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
private:
|
||||
|
||||
void setup ();
|
||||
|
||||
|
||||
boost::shared_ptr<ARDOUR::Bundle> _bundle;
|
||||
uint32_t _channel;
|
||||
Gtk::Entry _name;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009 Paul Davis
|
||||
Copyright (C) 2009 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
|
||||
@@ -47,7 +47,7 @@ CairoWidget::on_expose_event (GdkEventExpose *event)
|
||||
Gdk::Rectangle content (0, 0, _width, _height);
|
||||
bool intersects;
|
||||
r.intersect (content, intersects);
|
||||
|
||||
|
||||
if (intersects) {
|
||||
|
||||
GdkDrawable* drawable = get_window()->gobj ();
|
||||
@@ -79,7 +79,7 @@ CairoWidget::on_expose_event (GdkEventExpose *event)
|
||||
r.get_height()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009 Paul Davis
|
||||
Copyright (C) 2009 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
|
||||
@@ -43,7 +43,7 @@ protected:
|
||||
|
||||
int _width; ///< pixmap width
|
||||
int _height; ///< pixmap height
|
||||
|
||||
|
||||
private:
|
||||
bool _dirty; ///< true if the pixmap requires re-rendering
|
||||
GdkPixmap* _pixmap; ///< our pixmap
|
||||
|
||||
@@ -46,7 +46,7 @@ struct _GnomeCanvasCurve
|
||||
float* vector;
|
||||
size_t veclen;
|
||||
uint32_t color;
|
||||
|
||||
|
||||
/* cached values set during update/used during render */
|
||||
|
||||
unsigned char r, b, g, a;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
using namespace Gnome::Canvas;
|
||||
using namespace std;
|
||||
|
||||
void
|
||||
void
|
||||
CanvasFlag::delete_allocated_objects()
|
||||
{
|
||||
delete _text;
|
||||
@@ -18,11 +18,11 @@ CanvasFlag::delete_allocated_objects()
|
||||
_rect = 0;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
CanvasFlag::set_text(const string& a_text)
|
||||
{
|
||||
delete_allocated_objects();
|
||||
|
||||
|
||||
_text = new InteractiveText(*this, this, 0.0, 0.0, Glib::ustring(a_text));
|
||||
_text->property_justification() = Gtk::JUSTIFY_CENTER;
|
||||
_text->property_fill_color_rgba() = _outline_color_rgba;
|
||||
@@ -36,7 +36,7 @@ CanvasFlag::set_text(const string& a_text)
|
||||
_rect = new InteractiveRect(*this, this, 0.0, 0.0, flagwidth, flagheight);
|
||||
_rect->property_outline_color_rgba() = _outline_color_rgba;
|
||||
_rect->property_fill_color_rgba() = _fill_color_rgba;
|
||||
_text->raise_to_top();
|
||||
_text->raise_to_top();
|
||||
}
|
||||
|
||||
CanvasFlag::~CanvasFlag()
|
||||
|
||||
@@ -36,9 +36,9 @@ public:
|
||||
, _line(0)
|
||||
, _rect(0)
|
||||
{}
|
||||
|
||||
|
||||
virtual ~CanvasFlag();
|
||||
|
||||
|
||||
virtual bool on_event(GdkEvent* ev);
|
||||
|
||||
void set_text(const std::string& a_text);
|
||||
@@ -49,10 +49,10 @@ protected:
|
||||
guint _outline_color_rgba;
|
||||
guint _fill_color_rgba;
|
||||
MidiRegionView& _region;
|
||||
|
||||
|
||||
private:
|
||||
void delete_allocated_objects();
|
||||
|
||||
|
||||
SimpleLine* _line;
|
||||
InteractiveRect* _rect;
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ CanvasHit::on_event(GdkEvent* ev)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
CanvasHit::move_event(double dx, double dy)
|
||||
{
|
||||
move_by (dx, dy);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Author: Dave Robillard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
: Diamond(group, size), CanvasNoteEvent(region, this, note)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void show() { Diamond::show(); }
|
||||
void hide() { Diamond::hide(); }
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
double y1() { double x1, y1, x2, y2; get_bounds(x1,y1,x2,y2); return y1; }
|
||||
double x2() { double x1, y1, x2, y2; get_bounds(x1,y1,x2,y2); return x2; }
|
||||
double y2() { double x1, y1, x2, y2; get_bounds(x1,y1,x2,y2); return y2; }
|
||||
|
||||
|
||||
void set_outline_color(uint32_t c) { property_outline_color_rgba() = c; }
|
||||
void set_fill_color(uint32_t c) { property_fill_color_rgba() = c; }
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
*
|
||||
* Author: Federico Mena <federico@nuclecu.unam.mx>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <string.h> /* for memcpy() */
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
@@ -103,7 +103,7 @@ gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
|
||||
g_param_spec_pointer ("pixbuf",
|
||||
_("pixbuf"),
|
||||
_("the pixbuf"),
|
||||
G_PARAM_WRITABLE));
|
||||
G_PARAM_WRITABLE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_X,
|
||||
g_param_spec_double ("x",
|
||||
@@ -112,8 +112,8 @@ gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_Y,
|
||||
g_param_spec_double ("y",
|
||||
@@ -122,7 +122,7 @@ gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_WIDTH,
|
||||
g_param_spec_double ("width",
|
||||
@@ -131,8 +131,8 @@ gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_DRAWWIDTH,
|
||||
g_param_spec_double ("drawwidth",
|
||||
@@ -141,7 +141,7 @@ gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_HEIGHT,
|
||||
g_param_spec_double ("height",
|
||||
@@ -150,7 +150,7 @@ gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_ANCHOR,
|
||||
g_param_spec_enum ("anchor",
|
||||
@@ -158,7 +158,7 @@ gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
|
||||
_("the anchor"),
|
||||
GTK_TYPE_ANCHOR_TYPE,
|
||||
GTK_ANCHOR_NW,
|
||||
G_PARAM_READWRITE));
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
object_class->destroy = gnome_canvas_imageframe_destroy;
|
||||
|
||||
@@ -191,7 +191,7 @@ gnome_canvas_imageframe_destroy (GtkObject *object)
|
||||
g_return_if_fail (GNOME_CANVAS_IS_CANVAS_IMAGEFRAME (object));
|
||||
|
||||
image = GNOME_CANVAS_IMAGEFRAME (object);
|
||||
|
||||
|
||||
image->cwidth = 0;
|
||||
image->cheight = 0;
|
||||
|
||||
@@ -315,7 +315,7 @@ gnome_canvas_imageframe_set_property (GObject *object,
|
||||
image->height = fabs (g_value_get_double (value));
|
||||
update = TRUE;
|
||||
break;
|
||||
|
||||
|
||||
case PROP_DRAWWIDTH:
|
||||
image->drawwidth = fabs (g_value_get_double (value));
|
||||
update = TRUE;
|
||||
@@ -357,11 +357,11 @@ gnome_canvas_imageframe_get_property (GObject *object,
|
||||
case PROP_WIDTH:
|
||||
g_value_set_double (value, image->width);
|
||||
break;
|
||||
|
||||
|
||||
case PROP_HEIGHT:
|
||||
g_value_set_double (value, image->height);
|
||||
break;
|
||||
|
||||
|
||||
case PROP_DRAWWIDTH:
|
||||
g_value_set_double (value, image->drawwidth);
|
||||
break;
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
*
|
||||
* Author: Federico Mena <federico@nuclecu.unam.mx>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __GNOME_CANVAS_IMAGEFRAME_H__
|
||||
#define __GNOME_CANVAS_IMAGEFRAME_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <libgnomecanvas/libgnomecanvas.h>
|
||||
#include <gtk/gtkenums.h>
|
||||
#include <gtk/gtkenums.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -32,9 +32,9 @@ namespace Canvas {
|
||||
|
||||
/// dividing the hue circle in 16 parts, hand adjusted for equal look, courtesy Thorsten Wilms
|
||||
const uint32_t CanvasNoteEvent::midi_channel_colors[16] = {
|
||||
0xd32d2dff, 0xd36b2dff, 0xd3972dff, 0xd3d12dff,
|
||||
0xa0d32dff, 0x7dd32dff, 0x2dd45eff, 0x2dd3c4ff,
|
||||
0x2da5d3ff, 0x2d6fd3ff, 0x432dd3ff, 0x662dd3ff,
|
||||
0xd32d2dff, 0xd36b2dff, 0xd3972dff, 0xd3d12dff,
|
||||
0xa0d32dff, 0x7dd32dff, 0x2dd45eff, 0x2dd3c4ff,
|
||||
0x2da5d3ff, 0x2d6fd3ff, 0x432dd3ff, 0x662dd3ff,
|
||||
0x832dd3ff, 0xa92dd3ff, 0xd32dbfff, 0xd32d67ff
|
||||
};
|
||||
|
||||
@@ -51,13 +51,13 @@ CanvasNoteEvent::CanvasNoteEvent(MidiRegionView& region, Item* item,
|
||||
{
|
||||
}
|
||||
|
||||
CanvasNoteEvent::~CanvasNoteEvent()
|
||||
{
|
||||
CanvasNoteEvent::~CanvasNoteEvent()
|
||||
{
|
||||
if (_text) {
|
||||
_text->hide();
|
||||
delete _text;
|
||||
}
|
||||
|
||||
|
||||
delete _channel_selector_widget;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ CanvasNoteEvent::hide_velocity()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
CanvasNoteEvent::on_channel_selection_change(uint16_t selection)
|
||||
{
|
||||
// make note change its color if its channel is not marked active
|
||||
@@ -116,7 +116,7 @@ CanvasNoteEvent::on_channel_selection_change(uint16_t selection)
|
||||
_item->show();
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
CanvasNoteEvent::on_channel_change(uint8_t channel)
|
||||
{
|
||||
_region.note_selected(this, true);
|
||||
@@ -134,11 +134,11 @@ CanvasNoteEvent::show_channel_selector(void)
|
||||
_channel_selector->channel_selected.connect(
|
||||
sigc::mem_fun(this, &CanvasNoteEvent::on_channel_change));
|
||||
|
||||
_channel_selector_widget = new Widget(*(_item->property_parent()),
|
||||
x1(),
|
||||
y2() + 2,
|
||||
_channel_selector_widget = new Widget(*(_item->property_parent()),
|
||||
x1(),
|
||||
y2() + 2,
|
||||
(Gtk::Widget &) *_channel_selector);
|
||||
|
||||
|
||||
_channel_selector_widget->hide();
|
||||
_channel_selector_widget->property_height() = 100;
|
||||
_channel_selector_widget->property_width() = 100;
|
||||
@@ -179,35 +179,35 @@ CanvasNoteEvent::selected(bool selected)
|
||||
|
||||
#define SCALE_USHORT_TO_UINT8_T(x) ((x) / 257)
|
||||
|
||||
uint32_t
|
||||
uint32_t
|
||||
CanvasNoteEvent::base_color()
|
||||
{
|
||||
using namespace ARDOUR;
|
||||
|
||||
|
||||
ColorMode mode = _region.color_mode();
|
||||
|
||||
|
||||
const uint8_t min_opacity = 15;
|
||||
uint8_t opacity = std::max(min_opacity, uint8_t(_note->velocity() + _note->velocity()));
|
||||
|
||||
|
||||
switch (mode) {
|
||||
case TrackColor:
|
||||
{
|
||||
Gdk::Color color = _region.midi_stream_view()->get_region_color();
|
||||
return RGBA_TO_UINT(
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_red()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_green()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_blue()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_red()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_green()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_blue()),
|
||||
opacity);
|
||||
}
|
||||
|
||||
|
||||
case ChannelColors:
|
||||
return UINT_RGBA_CHANGE_A(CanvasNoteEvent::midi_channel_colors[_note->channel()],
|
||||
return UINT_RGBA_CHANGE_A(CanvasNoteEvent::midi_channel_colors[_note->channel()],
|
||||
opacity);
|
||||
|
||||
|
||||
default:
|
||||
return meter_style_fill_color(_note->velocity());
|
||||
};
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Author: Dave Robillard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -74,24 +74,24 @@ public:
|
||||
void selected(bool yn);
|
||||
|
||||
virtual void move_event(double dx, double dy) = 0;
|
||||
|
||||
|
||||
uint32_t base_color();
|
||||
|
||||
|
||||
void show_velocity();
|
||||
void hide_velocity();
|
||||
|
||||
|
||||
/** Channel changed for this specific event */
|
||||
void on_channel_change(uint8_t channel);
|
||||
|
||||
/** Channel selection changed */
|
||||
void on_channel_selection_change(uint16_t selection);
|
||||
|
||||
|
||||
void show_channel_selector();
|
||||
void hide_channel_selector();
|
||||
|
||||
virtual void set_outline_color(uint32_t c) = 0;
|
||||
virtual void set_fill_color(uint32_t c) = 0;
|
||||
|
||||
|
||||
virtual double x1() = 0;
|
||||
virtual double y1() = 0;
|
||||
virtual double x2() = 0;
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
|
||||
const boost::shared_ptr<NoteType> note() const { return _note; }
|
||||
MidiRegionView& region_view() const { return _region; }
|
||||
|
||||
|
||||
inline static uint32_t meter_style_fill_color(uint8_t vel) {
|
||||
if (vel < 64) {
|
||||
return UINT_INTERPOLATE(
|
||||
@@ -113,12 +113,12 @@ public:
|
||||
((vel-64) / (double)63.0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// calculate outline colors from fill colors of notes
|
||||
inline static uint32_t calculate_outline(uint32_t color) {
|
||||
return UINT_INTERPOLATE(color, 0x000000ff, 0.5);
|
||||
}
|
||||
|
||||
|
||||
/// hue circle divided into 16 equal-looking parts, courtesy Thorsten Wilms
|
||||
static const uint32_t midi_channel_colors[16];
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ CanvasNote::on_event(GdkEvent* ev)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
CanvasNote::move_event(double dx, double dy)
|
||||
{
|
||||
property_x1() = property_x1() + dx;
|
||||
|
||||
@@ -24,10 +24,10 @@ CanvasProgramChange::CanvasProgramChange(
|
||||
uint8_t channel,
|
||||
uint8_t program)
|
||||
: CanvasFlag(
|
||||
region,
|
||||
parent,
|
||||
height,
|
||||
ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get(),
|
||||
region,
|
||||
parent,
|
||||
height,
|
||||
ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get(),
|
||||
ARDOUR_UI::config()->canvasvar_MidiProgramChangeFill.get(),
|
||||
x,
|
||||
y)
|
||||
@@ -45,57 +45,57 @@ CanvasProgramChange::~CanvasProgramChange()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
CanvasProgramChange::initialize_popup_menus()
|
||||
{
|
||||
boost::shared_ptr<ChannelNameSet> channel_name_set =
|
||||
boost::shared_ptr<ChannelNameSet> channel_name_set =
|
||||
MidiPatchManager::instance()
|
||||
.find_channel_name_set(_model_name, _custom_device_mode, _channel);
|
||||
|
||||
if (!channel_name_set) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const ChannelNameSet::PatchBanks& patch_banks = channel_name_set->patch_banks();
|
||||
|
||||
|
||||
// fill popup menu:
|
||||
Gtk::Menu::MenuList& patch_bank_menus = _popup.items();
|
||||
|
||||
|
||||
for (ChannelNameSet::PatchBanks::const_iterator bank = patch_banks.begin();
|
||||
bank != patch_banks.end();
|
||||
++bank) {
|
||||
Glib::RefPtr<Glib::Regex> underscores = Glib::Regex::create("_");
|
||||
Glib::ustring replacement(" ");
|
||||
|
||||
|
||||
Gtk::Menu& patch_bank_menu = *manage(new Gtk::Menu());
|
||||
|
||||
|
||||
const PatchBank::PatchNameList& patches = (*bank)->patch_name_list();
|
||||
Gtk::Menu::MenuList& patch_menus = patch_bank_menu.items();
|
||||
|
||||
|
||||
for (PatchBank::PatchNameList::const_iterator patch = patches.begin();
|
||||
patch != patches.end();
|
||||
++patch) {
|
||||
Glib::ustring name = underscores->replace((*patch)->name().c_str(), -1, 0, replacement);
|
||||
|
||||
|
||||
patch_menus.push_back(
|
||||
Gtk::Menu_Helpers::MenuElem(
|
||||
name,
|
||||
name,
|
||||
sigc::bind(
|
||||
sigc::mem_fun(*this, &CanvasProgramChange::on_patch_menu_selected),
|
||||
(*patch)->patch_primary_key())) );
|
||||
sigc::mem_fun(*this, &CanvasProgramChange::on_patch_menu_selected),
|
||||
(*patch)->patch_primary_key())) );
|
||||
}
|
||||
|
||||
|
||||
Glib::ustring name = underscores->replace((*bank)->name().c_str(), -1, 0, replacement);
|
||||
|
||||
patch_bank_menus.push_back(
|
||||
|
||||
patch_bank_menus.push_back(
|
||||
Gtk::Menu_Helpers::MenuElem(
|
||||
name,
|
||||
patch_bank_menu) );
|
||||
name,
|
||||
patch_bank_menu) );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
CanvasProgramChange::on_patch_menu_selected(const PatchPrimaryKey& key)
|
||||
{
|
||||
cerr << " got patch program number " << key.program_number << endl;
|
||||
@@ -117,7 +117,7 @@ CanvasProgramChange::on_event(GdkEvent* ev)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case GDK_SCROLL:
|
||||
if (ev->scroll.direction == GDK_SCROLL_UP) {
|
||||
_region.previous_program(*this);
|
||||
@@ -125,12 +125,12 @@ CanvasProgramChange::on_event(GdkEvent* ev)
|
||||
} else if (ev->scroll.direction == GDK_SCROLL_DOWN) {
|
||||
_region.next_program(*this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -30,14 +30,14 @@ public:
|
||||
uint8_t channel,
|
||||
uint8_t program
|
||||
);
|
||||
|
||||
|
||||
virtual ~CanvasProgramChange();
|
||||
|
||||
|
||||
virtual bool on_event(GdkEvent* ev);
|
||||
|
||||
|
||||
string model_name() const { return _model_name; }
|
||||
void set_model_name(string model_name) { _model_name = model_name; }
|
||||
|
||||
|
||||
string custom_device_mode() const { return _custom_device_mode; }
|
||||
void set_custom_device_mode(string custom_device_mode) { _custom_device_mode = custom_device_mode; }
|
||||
|
||||
@@ -49,14 +49,14 @@ public:
|
||||
|
||||
uint8_t channel() const { return _channel; }
|
||||
void set_channel(uint8_t new_channel) { _channel = new_channel; };
|
||||
|
||||
|
||||
void initialize_popup_menus();
|
||||
|
||||
|
||||
void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey& key);
|
||||
|
||||
private:
|
||||
string _model_name;
|
||||
string _custom_device_mode;
|
||||
string _custom_device_mode;
|
||||
nframes_t _event_time;
|
||||
uint8_t _channel;
|
||||
uint8_t _program;
|
||||
|
||||
@@ -104,7 +104,7 @@ gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
|
||||
|
||||
gobject_class->set_property = gnome_canvas_simpleline_set_property;
|
||||
gobject_class->get_property = gnome_canvas_simpleline_get_property;
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_X1,
|
||||
g_param_spec_double ("x1",
|
||||
@@ -113,8 +113,8 @@ gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_Y1,
|
||||
g_param_spec_double ("y1",
|
||||
@@ -123,8 +123,8 @@ gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_X2,
|
||||
@@ -134,8 +134,8 @@ gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_Y2,
|
||||
g_param_spec_double ("y2",
|
||||
@@ -144,7 +144,7 @@ gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_COLOR_RGBA,
|
||||
g_param_spec_uint ("color_rgba",
|
||||
@@ -153,8 +153,8 @@ gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
|
||||
0,
|
||||
G_MAXUINT,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
object_class->destroy = gnome_canvas_simpleline_destroy;
|
||||
|
||||
item_class->update = gnome_canvas_simpleline_update;
|
||||
@@ -204,7 +204,7 @@ gnome_canvas_simpleline_bounds_world (GnomeCanvasItem *item, int* ix1, int* iy1,
|
||||
i1.y = y1;
|
||||
i2.x = x2;
|
||||
i2.y = y2;
|
||||
|
||||
|
||||
gnome_canvas_item_i2w_affine (item, i2w);
|
||||
art_affine_point (&w1, &i1, i2w);
|
||||
art_affine_point (&w2, &i2, i2w);
|
||||
@@ -225,7 +225,7 @@ gnome_canvas_simpleline_bounds_world (GnomeCanvasItem *item, int* ix1, int* iy1,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gnome_canvas_simpleline_reset_bounds (GnomeCanvasItem *item)
|
||||
{
|
||||
int Ix1, Ix2, Iy1, Iy2;
|
||||
@@ -234,8 +234,8 @@ gnome_canvas_simpleline_reset_bounds (GnomeCanvasItem *item)
|
||||
gnome_canvas_update_bbox (item, Ix1, Iy1, Ix2, Iy2);
|
||||
}
|
||||
|
||||
/*
|
||||
* CANVAS CALLBACKS
|
||||
/*
|
||||
* CANVAS CALLBACKS
|
||||
*/
|
||||
|
||||
static void
|
||||
@@ -246,7 +246,7 @@ gnome_canvas_simpleline_set_property (GObject *object,
|
||||
|
||||
{
|
||||
(void) pspec;
|
||||
|
||||
|
||||
GnomeCanvasSimpleLine *simpleline;
|
||||
int update = FALSE;
|
||||
int bounds_changed = FALSE;
|
||||
@@ -284,7 +284,7 @@ gnome_canvas_simpleline_set_property (GObject *object,
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case PROP_COLOR_RGBA:
|
||||
if (simpleline->color != g_value_get_uint(value)) {
|
||||
simpleline->color = g_value_get_uint(value);
|
||||
@@ -309,7 +309,7 @@ gnome_canvas_simpleline_get_property (GObject *object,
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GNOME_IS_CANVAS_SIMPLELINE (object));
|
||||
|
||||
|
||||
GnomeCanvasSimpleLine *line = GNOME_CANVAS_SIMPLELINE (object);
|
||||
|
||||
switch (prop_id) {
|
||||
@@ -381,13 +381,13 @@ gnome_canvas_simpleline_render (GnomeCanvasItem *item,
|
||||
|
||||
//begin = MAX(simpleline->bbox_ulx,buf->rect.x0);
|
||||
//end = MIN(simpleline->bbox_lrx,buf->rect.x1);
|
||||
|
||||
|
||||
begin = simpleline->bbox_ulx;
|
||||
end = simpleline->bbox_lrx;
|
||||
|
||||
if (simpleline->color != 0) {
|
||||
if (simpleline->horizontal) {
|
||||
PAINT_HORIZA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
|
||||
PAINT_HORIZA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
|
||||
begin, end, simpleline->bbox_uly);
|
||||
} else {
|
||||
PAINT_VERTA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
|
||||
@@ -442,10 +442,10 @@ gnome_canvas_simpleline_draw (GnomeCanvasItem *item,
|
||||
lrx -= x;
|
||||
lry -= y;
|
||||
|
||||
cairo_set_source_rgba (cr,
|
||||
simpleline->r/255.0,
|
||||
simpleline->g/255.0,
|
||||
simpleline->b/255.0,
|
||||
cairo_set_source_rgba (cr,
|
||||
simpleline->r/255.0,
|
||||
simpleline->g/255.0,
|
||||
simpleline->b/255.0,
|
||||
simpleline->a/255.0);
|
||||
cairo_set_line_width (cr, 1);
|
||||
cairo_move_to (cr, ulx+0.5, uly+0.5);
|
||||
@@ -469,7 +469,7 @@ gnome_canvas_simpleline_point (GnomeCanvasItem *item, double x, double y, int cx
|
||||
{
|
||||
(void) cx;
|
||||
(void) cy;
|
||||
|
||||
|
||||
GnomeCanvasSimpleLine *simpleline;
|
||||
double x1, y1, x2, y2;
|
||||
double dx, dy;
|
||||
@@ -483,7 +483,7 @@ gnome_canvas_simpleline_point (GnomeCanvasItem *item, double x, double y, int cx
|
||||
gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2);
|
||||
|
||||
/* Is point inside line */
|
||||
|
||||
|
||||
if ((x >= x1) && (y >= y1) && (x <= x2) && (y <= y2)) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ enum {
|
||||
PROP_FILL_COLOR_RGBA,
|
||||
PROP_OUTLINE_COLOR_RGBA,
|
||||
PROP_DRAW
|
||||
|
||||
|
||||
};
|
||||
|
||||
static void gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class);
|
||||
@@ -95,12 +95,12 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
gobject_class = (GObjectClass *) class;
|
||||
object_class = (GtkObjectClass *) class;
|
||||
item_class = (GnomeCanvasItemClass *) class;
|
||||
|
||||
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
gobject_class->set_property = gnome_canvas_simplerect_set_property;
|
||||
gobject_class->get_property = gnome_canvas_simplerect_get_property;
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_X1,
|
||||
g_param_spec_double ("x1",
|
||||
@@ -109,8 +109,8 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_Y1,
|
||||
g_param_spec_double ("y1",
|
||||
@@ -119,8 +119,8 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_X2,
|
||||
@@ -130,8 +130,8 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_Y2,
|
||||
g_param_spec_double ("y2",
|
||||
@@ -140,8 +140,8 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
-G_MAXDOUBLE,
|
||||
G_MAXDOUBLE,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_OUTLINE_PIXELS,
|
||||
@@ -151,8 +151,8 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
0,
|
||||
G_MAXUINT,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_OUTLINE_WHAT,
|
||||
@@ -162,8 +162,8 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
0,
|
||||
G_MAXUINT,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
@@ -172,16 +172,16 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
_("fill"),
|
||||
_("fill rectangle"),
|
||||
TRUE,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_DRAW,
|
||||
g_param_spec_boolean ("draw",
|
||||
_("draw"),
|
||||
_("draw rectangle"),
|
||||
TRUE,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_OUTLINE_COLOR_RGBA,
|
||||
@@ -191,8 +191,8 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
0,
|
||||
G_MAXUINT,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_FILL_COLOR_RGBA,
|
||||
@@ -202,7 +202,7 @@ gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
0,
|
||||
G_MAXUINT,
|
||||
0,
|
||||
G_PARAM_READWRITE));
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
object_class->destroy = gnome_canvas_simplerect_destroy;
|
||||
|
||||
@@ -234,7 +234,7 @@ static void
|
||||
gnome_canvas_simplerect_destroy (GtkObject *object)
|
||||
{
|
||||
GnomeCanvasSimpleRect *rect;
|
||||
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GNOME_IS_CANVAS_SIMPLERECT (object));
|
||||
|
||||
@@ -259,7 +259,7 @@ gnome_canvas_simplerect_bounds (GnomeCanvasItem *item, double *x1, double *y1, d
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
|
||||
{
|
||||
GnomeCanvasSimpleRect* simplerect;
|
||||
@@ -271,7 +271,7 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
|
||||
old_y1 = item->y1;
|
||||
old_x2 = item->x2;
|
||||
old_y2 = item->y2;
|
||||
|
||||
|
||||
gnome_canvas_simplerect_bounds (item, &x1, &y1, &x2, &y2);
|
||||
gnome_canvas_item_i2w (item, &x1, &y1);
|
||||
gnome_canvas_item_i2w (item, &x2, &y2);
|
||||
@@ -331,7 +331,7 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
|
||||
} else if (item->x2 == old_x2) {
|
||||
|
||||
/* end didn't change, so just draw at the start */
|
||||
|
||||
|
||||
double start_x = MIN (item->x1, old_x1);
|
||||
double end_x = MAX (item->x1, old_x1);
|
||||
|
||||
@@ -339,7 +339,7 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new.x0 = x1;
|
||||
new.y0 = y1;
|
||||
@@ -352,15 +352,15 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
|
||||
old.y1 = old_y2;
|
||||
|
||||
art_drect_union (&unionrect, &old, &new);
|
||||
gnome_canvas_request_redraw (item->canvas,
|
||||
gnome_canvas_request_redraw (item->canvas,
|
||||
unionrect.x0 - 0.5,
|
||||
unionrect.y0 - 0.5,
|
||||
unionrect.x1 + 1.5,
|
||||
unionrect.y1 + 1.5);
|
||||
}
|
||||
|
||||
/*
|
||||
* CANVAS CALLBACKS
|
||||
/*
|
||||
* CANVAS CALLBACKS
|
||||
*/
|
||||
|
||||
static void
|
||||
@@ -371,7 +371,7 @@ gnome_canvas_simplerect_set_property (GObject *object,
|
||||
|
||||
{
|
||||
(void) pspec;
|
||||
|
||||
|
||||
GnomeCanvasSimpleRect *simplerect;
|
||||
int update = FALSE;
|
||||
int bounds_changed = FALSE;
|
||||
@@ -470,7 +470,7 @@ gnome_canvas_simplerect_get_property (GObject *object,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GnomeCanvasSimpleRect *rect = GNOME_CANVAS_SIMPLERECT (object);
|
||||
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GNOME_IS_CANVAS_SIMPLERECT (object));
|
||||
|
||||
@@ -505,7 +505,7 @@ gnome_canvas_simplerect_get_property (GObject *object,
|
||||
case PROP_DRAW:
|
||||
g_value_set_boolean (value, rect->draw);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -527,7 +527,7 @@ gnome_canvas_simplerect_update (GnomeCanvasItem *item, double *affine, ArtSVP *c
|
||||
gnome_canvas_simplerect_reset_bounds (item);
|
||||
|
||||
if (simplerect->full_draw_on_update) {
|
||||
gnome_canvas_request_redraw (item->canvas,
|
||||
gnome_canvas_request_redraw (item->canvas,
|
||||
simplerect->bbox_ulx,
|
||||
simplerect->bbox_uly,
|
||||
simplerect->bbox_lrx+0.5,
|
||||
@@ -563,7 +563,7 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
||||
if (parent_class->render) {
|
||||
(*parent_class->render) (item, buf);
|
||||
}
|
||||
|
||||
|
||||
if (buf->is_bg) {
|
||||
|
||||
#ifdef HARLEQUIN_DEBUGGING
|
||||
@@ -580,7 +580,7 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
||||
if (!simplerect->draw) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
self.x0 = simplerect->bbox_ulx;
|
||||
self.y0 = simplerect->bbox_uly;
|
||||
self.x1 = simplerect->bbox_lrx;
|
||||
@@ -595,7 +595,7 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
||||
ey = simplerect->bbox_lry-1;
|
||||
|
||||
if (simplerect->fill) {
|
||||
|
||||
|
||||
// this can be useful for debugging/understanding how the canvas redraws
|
||||
// stuff.
|
||||
|
||||
@@ -605,12 +605,12 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
||||
randg = random() % 255;
|
||||
randb = random() % 255;
|
||||
PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey);
|
||||
#else
|
||||
PAINT_BOX (buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a,
|
||||
#else
|
||||
PAINT_BOX (buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a,
|
||||
intersection.x0, intersection.y0,
|
||||
intersection.x1, intersection.y1);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (i = 0; i < simplerect->outline_pixels; ++i) {
|
||||
@@ -630,7 +630,7 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
||||
if (simplerect->outline_what & 0x4) {
|
||||
PAINT_HORIZ(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, begin, end, sy+i);
|
||||
}
|
||||
|
||||
|
||||
if (simplerect->outline_what & 0x8) {
|
||||
PAINT_HORIZ(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, begin, end + 1, ey-i);
|
||||
}
|
||||
@@ -678,14 +678,14 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
||||
ey = simplerect->bbox_lry-1;
|
||||
|
||||
if (simplerect->fill) {
|
||||
|
||||
|
||||
#ifdef HARLEQUIN_DEBUGGING
|
||||
gint randr, randg, randb;
|
||||
randr = random() % 255;
|
||||
randg = random() % 255;
|
||||
randb = random() % 255;
|
||||
PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey);
|
||||
#else
|
||||
#else
|
||||
PAINT_BOX(buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a, begin, sy, end, ey);
|
||||
#endif
|
||||
}
|
||||
@@ -707,7 +707,7 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
||||
if (simplerect->outline_what & 0x4) {
|
||||
PAINT_HORIZ(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, begin, end, sy+i);
|
||||
}
|
||||
|
||||
|
||||
if (simplerect->outline_what & 0x8) {
|
||||
PAINT_HORIZ(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, begin, end + 1, ey-i);
|
||||
}
|
||||
@@ -730,7 +730,7 @@ gnome_canvas_simplerect_draw (GnomeCanvasItem *item,
|
||||
|
||||
simplerect = GNOME_CANVAS_SIMPLERECT (item);
|
||||
|
||||
cr = gdk_cairo_create (drawable);
|
||||
cr = gdk_cairo_create (drawable);
|
||||
|
||||
if (x > simplerect->bbox_ulx) {
|
||||
ulx = x;
|
||||
@@ -765,23 +765,23 @@ gnome_canvas_simplerect_draw (GnomeCanvasItem *item,
|
||||
|
||||
if (simplerect->fill) {
|
||||
cairo_set_source_rgba (cr,
|
||||
simplerect->fill_r/255.0,
|
||||
simplerect->fill_g/255.0,
|
||||
simplerect->fill_b/255.0,
|
||||
simplerect->fill_r/255.0,
|
||||
simplerect->fill_g/255.0,
|
||||
simplerect->fill_b/255.0,
|
||||
simplerect->fill_a/255.0);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
|
||||
if (simplerect->outline_what && simplerect->outline_pixels) {
|
||||
|
||||
#define x_in_range(a) (x <= (a) && (a) < x + width)
|
||||
#define y_in_range(a) (y <= (a) && (a) < y + height)
|
||||
|
||||
cairo_set_line_width (cr, simplerect->outline_pixels);
|
||||
|
||||
|
||||
cairo_set_source_rgb (cr,
|
||||
simplerect->outline_r/255.0,
|
||||
simplerect->outline_g/255.0,
|
||||
simplerect->outline_r/255.0,
|
||||
simplerect->outline_g/255.0,
|
||||
simplerect->outline_b/255.0);
|
||||
|
||||
if (simplerect->outline_what & 0x1) {
|
||||
@@ -792,7 +792,7 @@ gnome_canvas_simplerect_draw (GnomeCanvasItem *item,
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (simplerect->outline_what & 0x2) {
|
||||
/* right edge, if visible */
|
||||
if (x_in_range (simplerect->bbox_lrx)) {
|
||||
@@ -801,7 +801,7 @@ gnome_canvas_simplerect_draw (GnomeCanvasItem *item,
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (simplerect->outline_what & 0x4) {
|
||||
/* top edge */
|
||||
if (y_in_range (simplerect->bbox_uly)) {
|
||||
@@ -810,7 +810,7 @@ gnome_canvas_simplerect_draw (GnomeCanvasItem *item,
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (simplerect->outline_what & 0x8) {
|
||||
/* bottom edge */
|
||||
if (y_in_range (simplerect->bbox_lry)) {
|
||||
@@ -829,7 +829,7 @@ gnome_canvas_simplerect_point (GnomeCanvasItem *item, double x, double y, int cx
|
||||
{
|
||||
(void) cx;
|
||||
(void) cy;
|
||||
|
||||
|
||||
GnomeCanvasSimpleRect *simplerect;
|
||||
double x1, y1, x2, y2;
|
||||
double dx, dy;
|
||||
@@ -843,7 +843,7 @@ gnome_canvas_simplerect_point (GnomeCanvasItem *item, double x, double y, int cx
|
||||
gnome_canvas_simplerect_bounds (item, &x1, &y1, &x2, &y2);
|
||||
|
||||
/* Is point inside rectangle */
|
||||
|
||||
|
||||
if ((x >= x1) && (y >= y1) && (x <= x2) && (y <= y2)) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -34,10 +34,10 @@ CanvasSysEx::CanvasSysEx(
|
||||
double x,
|
||||
double y)
|
||||
: CanvasFlag(
|
||||
region,
|
||||
parent,
|
||||
height,
|
||||
ARDOUR_UI::config()->canvasvar_MidiSysExOutline.get(),
|
||||
region,
|
||||
parent,
|
||||
height,
|
||||
ARDOUR_UI::config()->canvasvar_MidiSysExOutline.get(),
|
||||
ARDOUR_UI::config()->canvasvar_MidiSysExFill.get(),
|
||||
x,
|
||||
y)
|
||||
@@ -58,19 +58,19 @@ CanvasSysEx::on_event(GdkEvent* ev)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case GDK_SCROLL:
|
||||
if (ev->scroll.direction == GDK_SCROLL_UP) {
|
||||
return true;
|
||||
} else if (ev->scroll.direction == GDK_SCROLL_DOWN) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ public:
|
||||
double height,
|
||||
double x,
|
||||
double y);
|
||||
|
||||
|
||||
virtual ~CanvasSysEx();
|
||||
|
||||
|
||||
virtual bool on_event(GdkEvent* ev);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2002 Paul Davis
|
||||
Copyright (C) 2000-2002 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
|
||||
@@ -163,106 +163,106 @@ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
|
||||
PROP_DATA_SRC,
|
||||
g_param_spec_pointer ("data_src", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CHANNEL,
|
||||
g_param_spec_uint ("channel", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_LENGTH_FUNCTION,
|
||||
g_param_spec_pointer ("length_function", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_SOURCEFILE_LENGTH_FUNCTION,
|
||||
g_param_spec_pointer ("sourcefile_length_function", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_PEAK_FUNCTION,
|
||||
g_param_spec_pointer ("peak_function", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_GAIN_FUNCTION,
|
||||
g_param_spec_pointer ("gain_function", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_GAIN_SRC,
|
||||
g_param_spec_pointer ("gain_src", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CACHE,
|
||||
g_param_spec_pointer ("cache", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CACHE_UPDATER,
|
||||
g_param_spec_boolean ("cache_updater", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_SAMPLES_PER_UNIT,
|
||||
g_param_spec_double ("samples_per_unit", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_AMPLITUDE_ABOVE_AXIS,
|
||||
g_param_spec_double ("amplitude_above_axis", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_X,
|
||||
g_param_spec_double ("x", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_Y,
|
||||
g_param_spec_double ("y", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_HEIGHT,
|
||||
g_param_spec_double ("height", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_WAVE_COLOR,
|
||||
g_param_spec_uint ("wave_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CLIP_COLOR,
|
||||
g_param_spec_uint ("clip_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_ZERO_COLOR,
|
||||
@@ -283,7 +283,7 @@ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
|
||||
g_param_spec_boolean ("filled", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_RECTIFIED,
|
||||
@@ -304,16 +304,16 @@ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
|
||||
g_param_spec_boolean ("logscaled", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_REGION_START,
|
||||
g_param_spec_uint ("region_start", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
|
||||
object_class->destroy = gnome_canvas_waveview_destroy;
|
||||
|
||||
|
||||
item_class->update = gnome_canvas_waveview_update;
|
||||
item_class->bounds = gnome_canvas_waveview_bounds;
|
||||
item_class->point = gnome_canvas_waveview_point;
|
||||
@@ -418,12 +418,12 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
#if DEBUG_CACHE
|
||||
// printf("waveview->region_start == %lu\n",waveview->region_start);
|
||||
// c_stacktrace ();
|
||||
printf ("\n\n=> 0x%x cache @ 0x%x range: %lu - %lu request: %lu - %lu (%lu frames)\n",
|
||||
printf ("\n\n=> 0x%x cache @ 0x%x range: %lu - %lu request: %lu - %lu (%lu frames)\n",
|
||||
waveview, cache,
|
||||
cache->start, cache->end,
|
||||
start_sample, end_sample, end_sample - start_sample);
|
||||
#endif
|
||||
|
||||
|
||||
if (cache->start <= start_sample && cache->end >= end_sample) {
|
||||
#if DEBUG_CACHE
|
||||
// printf ("0x%x: cache hit for %lu-%lu (cache holds: %lu-%lu\n",
|
||||
@@ -433,11 +433,11 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
}
|
||||
|
||||
/* make sure the cache is at least twice as wide as the screen width, and put the start sample
|
||||
in the middle, ensuring that we cover the end_sample.
|
||||
in the middle, ensuring that we cover the end_sample.
|
||||
*/
|
||||
|
||||
/* Note the assumption that we have a 1:1 units:pixel ratio for the canvas. Its everywhere ... */
|
||||
|
||||
|
||||
half_width = (gulong) floor ((waveview->screen_width * waveview->samples_per_unit)/2.0 + 0.5);
|
||||
|
||||
if (start_sample < half_width) {
|
||||
@@ -462,7 +462,7 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
}
|
||||
|
||||
#if DEBUG_CACHE
|
||||
fprintf (stderr, "AVAILABLE FRAMES = %lu of %lu, start = %lu, sstart = %lu, cstart = %lu\n",
|
||||
fprintf (stderr, "AVAILABLE FRAMES = %lu of %lu, start = %lu, sstart = %lu, cstart = %lu\n",
|
||||
rf3, waveview->sourcefile_length_function (waveview->data_src, waveview->samples_per_unit),
|
||||
waveview->region_start, start_sample, new_cache_start);
|
||||
#endif
|
||||
@@ -489,7 +489,7 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
ostart = new_cache_start;
|
||||
|
||||
#ifdef CACHE_MEMMOVE_OPTIMIZATION
|
||||
|
||||
|
||||
/* data is not entirely in the cache, so go fetch it, making sure to fill the cache */
|
||||
|
||||
/* some of the required cache entries are in the cache, but in the wrong
|
||||
@@ -497,24 +497,24 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
*/
|
||||
|
||||
if (cache->start < new_cache_start && new_cache_start < cache->end) {
|
||||
|
||||
/* case one: the common area is at the end of the existing cache. move it
|
||||
|
||||
/* case one: the common area is at the end of the existing cache. move it
|
||||
to the beginning of the cache, and set up to refill whatever remains.
|
||||
|
||||
|
||||
|
||||
|
||||
wv->cache_start wv->cache_end
|
||||
|-------------------------------------------------------| cache
|
||||
|--------------------------------| requested
|
||||
<------------------->
|
||||
"present"
|
||||
new_cache_start new_cache_end
|
||||
new_cache_start new_cache_end
|
||||
*/
|
||||
|
||||
|
||||
|
||||
present_frames = cache->end - new_cache_start;
|
||||
present_entries = (gulong) floor (present_frames / waveview->samples_per_unit);
|
||||
|
||||
#if DEBUG_CACHE
|
||||
#if DEBUG_CACHE
|
||||
fprintf (stderr, "existing material at end of current cache, move to start of new cache\n"
|
||||
"\tcopy from %lu to start\n", cache->data_size - present_entries);
|
||||
#endif
|
||||
@@ -522,7 +522,7 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
memmove (&cache->data[0],
|
||||
&cache->data[cache->data_size - present_entries],
|
||||
present_entries * sizeof (GnomeCanvasWaveViewCacheEntry));
|
||||
|
||||
|
||||
#if DEBUG_CACHE
|
||||
fprintf (stderr, "satisfied %lu of %lu frames, offset = %lu, will start at %lu (ptr = 0x%x)\n",
|
||||
present_frames, required_frames, present_entries, new_cache_start + present_entries,
|
||||
@@ -536,8 +536,8 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
|
||||
} else if (new_cache_end > cache->start && new_cache_end < cache->end) {
|
||||
|
||||
/* case two: the common area lives at the beginning of the existing cache.
|
||||
|
||||
/* case two: the common area lives at the beginning of the existing cache.
|
||||
|
||||
wv->cache_start wv->cache_end
|
||||
|-----------------------------------------------------|
|
||||
|--------------------------------|
|
||||
@@ -546,15 +546,15 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
|
||||
new_cache_start new_cache_end
|
||||
*/
|
||||
|
||||
|
||||
present_frames = new_cache_end - cache->start;
|
||||
present_entries = (gulong) floor (present_frames / waveview->samples_per_unit);
|
||||
|
||||
memmove (&cache->data[cache->data_size - present_entries],
|
||||
&cache->data[0],
|
||||
present_entries * sizeof (GnomeCanvasWaveViewCacheEntry));
|
||||
|
||||
#if DEBUG_CACHE
|
||||
|
||||
#if DEBUG_CACHE
|
||||
fprintf (stderr, "existing material at start of current cache, move to start of end cache\n");
|
||||
#endif
|
||||
|
||||
@@ -568,7 +568,7 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
offset = 0;
|
||||
required_frames -= present_frames;
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
copied = 0;
|
||||
offset = 0;
|
||||
@@ -605,7 +605,7 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
waveview->peak_function (waveview->data_src, npeaks, new_cache_start, required_frames, cache->data + offset, waveview->channel,waveview->samples_per_unit);
|
||||
|
||||
/* take into account any copied peaks */
|
||||
|
||||
|
||||
npeaks += copied;
|
||||
} else {
|
||||
npeaks = copied;
|
||||
@@ -634,15 +634,15 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
}
|
||||
|
||||
free (gain);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* do optional log scaling. this implementation is not particularly efficient */
|
||||
|
||||
|
||||
if (waveview->logscaled) {
|
||||
guint32 n;
|
||||
GnomeCanvasWaveViewCacheEntry* buf = cache->data;
|
||||
|
||||
|
||||
for (n = 0; n < cache->data_size; ++n) {
|
||||
|
||||
if (buf[n].max > 0.0f) {
|
||||
@@ -650,7 +650,7 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
} else if (buf[n].max < 0.0f) {
|
||||
buf[n].max = -alt_log_meter(fast_coefficient_to_dB(-buf[n].max));
|
||||
}
|
||||
|
||||
|
||||
if (buf[n].min > 0.0f) {
|
||||
buf[n].min = alt_log_meter(fast_coefficient_to_dB(buf[n].min));
|
||||
} else if (buf[n].min < 0.0f) {
|
||||
@@ -664,7 +664,7 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
|
||||
|
||||
out:
|
||||
#if DEBUG_CACHE
|
||||
fprintf (stderr, "return cache index = %d\n",
|
||||
fprintf (stderr, "return cache index = %d\n",
|
||||
(guint32) floor ((((double) (start_sample - cache->start)) / waveview->samples_per_unit) + 0.5));
|
||||
#endif
|
||||
return (guint32) floor ((((double) (start_sample - cache->start)) / waveview->samples_per_unit) + 0.5);
|
||||
@@ -680,7 +680,7 @@ gnome_canvas_waveview_set_data_src (GnomeCanvasWaveView *waveview, void *data_sr
|
||||
waveview->reload_cache_in_render = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
waveview->cache->start = 0;
|
||||
waveview->cache->end = 0;
|
||||
}
|
||||
@@ -694,11 +694,11 @@ gnome_canvas_waveview_set_channel (GnomeCanvasWaveView *waveview, guint32 chan)
|
||||
if (waveview->channel == chan) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
waveview->channel = chan;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gnome_canvas_waveview_reset_bounds (GnomeCanvasItem *item)
|
||||
|
||||
{
|
||||
@@ -727,8 +727,8 @@ gnome_canvas_waveview_reset_bounds (GnomeCanvasItem *item)
|
||||
gnome_canvas_update_bbox (item, Ix1, Iy1, Ix2, Iy2);
|
||||
}
|
||||
|
||||
/*
|
||||
* CANVAS CALLBACKS
|
||||
/*
|
||||
* CANVAS CALLBACKS
|
||||
*/
|
||||
|
||||
static void
|
||||
@@ -739,7 +739,7 @@ gnome_canvas_waveview_set_property (GObject *object,
|
||||
|
||||
{
|
||||
(void) pspec;
|
||||
|
||||
|
||||
GnomeCanvasItem *item;
|
||||
GnomeCanvasWaveView *waveview;
|
||||
int redraw = FALSE;
|
||||
@@ -929,8 +929,8 @@ gnome_canvas_waveview_get_property (
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GNOME_IS_CANVAS_WAVEVIEW (object));
|
||||
|
||||
@@ -1083,7 +1083,7 @@ gnome_canvas_waveview_update (GnomeCanvasItem *item, double *affine, ArtSVP *cli
|
||||
&waveview->fill_a);
|
||||
|
||||
// check_cache (waveview, "end of update");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
@@ -1186,7 +1186,7 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
|
||||
clip_length = MIN(5,(waveview->height/4));
|
||||
|
||||
/*
|
||||
/*
|
||||
Now draw each line, clipping it appropriately. The clipping
|
||||
is done by the macros PAINT_FOO().
|
||||
*/
|
||||
@@ -1240,40 +1240,40 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
guint index = cache_index + (end - begin);
|
||||
|
||||
if (index >= waveview->cache->data_size) {
|
||||
|
||||
|
||||
/* the data we want is off the end of the cache, which must mean its beyond
|
||||
the end of the region's source; hence the peak values are 0 */
|
||||
last_pymax = (int) rint ((item->y1 + origin) * item->canvas->pixels_per_unit);
|
||||
last_pymin = (int) rint ((item->y1 + origin) * item->canvas->pixels_per_unit);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
last_pymax = (int) rint ((item->y1 + origin - MIN(waveview->cache->data[index].max, 1.0) * half_height) * item->canvas->pixels_per_unit);
|
||||
last_pymin = (int) rint ((item->y1 + origin - MAX(waveview->cache->data[index].min, -1.0) * half_height) * item->canvas->pixels_per_unit);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* initialize NEXT* variables for the first run, duplicated in the loop for speed
|
||||
*/
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
next_clip_max = 1;
|
||||
}
|
||||
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
next_clip_min = 1;
|
||||
}
|
||||
|
||||
|
||||
max *= half_height;
|
||||
min *= half_height;
|
||||
|
||||
|
||||
next_pymax = (int) rint ((item->y1 + origin - max) * item->canvas->pixels_per_unit);
|
||||
next_pymin = (int) rint ((item->y1 + origin - min) * item->canvas->pixels_per_unit);
|
||||
|
||||
@@ -1311,7 +1311,7 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
max = 1.0;
|
||||
next_clip_max = 1;
|
||||
}
|
||||
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
next_clip_min = 1;
|
||||
@@ -1319,11 +1319,11 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
|
||||
max *= half_height;
|
||||
min *= half_height;
|
||||
|
||||
|
||||
next_pymax = (int) rint ((item->y1 + origin - max) * item->canvas->pixels_per_unit);
|
||||
next_pymin = (int) rint ((item->y1 + origin - min) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
|
||||
/* render */
|
||||
if (pymax == pymin) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin);
|
||||
@@ -1370,7 +1370,7 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
if (clip_max) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymax, pymax+clip_length);
|
||||
}
|
||||
|
||||
|
||||
if (clip_min) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymin-clip_length, pymin);
|
||||
}
|
||||
@@ -1426,7 +1426,7 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
if(last_pymax < 0) {
|
||||
/* take the index of one sample right of what we render */
|
||||
int index = cache_index + (end - begin);
|
||||
|
||||
|
||||
max = MIN(waveview->cache->data[index].max, 1.0);
|
||||
min = MAX(waveview->cache->data[index].min, -1.0);
|
||||
|
||||
@@ -1437,26 +1437,26 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
last_pymax = (int) rint ((item->y1 + waveview->height - max * waveview->height) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* initialize NEXT* variables for the first run, duplicated in the loop for speed
|
||||
*/
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
next_clip_max = 1;
|
||||
}
|
||||
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
next_clip_min = 1;
|
||||
}
|
||||
|
||||
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
next_pymax = (int) rint ((item->y1 + waveview->height - max * waveview->height) * item->canvas->pixels_per_unit);
|
||||
|
||||
/*
|
||||
@@ -1479,24 +1479,24 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
next_clip_max = 1;
|
||||
}
|
||||
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
next_clip_min = 1;
|
||||
}
|
||||
|
||||
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
next_pymax = (int) rint ((item->y1 + waveview->height - max * waveview->height) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
|
||||
/* render */
|
||||
if (pymax == pymin) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin);
|
||||
@@ -1528,7 +1528,7 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
if (clip_max) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymax, pymax+clip_length);
|
||||
}
|
||||
|
||||
|
||||
if (clip_min) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymin-clip_length, pymin);
|
||||
}
|
||||
@@ -1540,68 +1540,68 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
cache_index = gnome_canvas_waveview_ensure_cache (waveview, s1, s2);
|
||||
|
||||
for (x = begin; x < end; x++) {
|
||||
|
||||
|
||||
double max, min;
|
||||
int clip_max, clip_min;
|
||||
|
||||
|
||||
clip_max = 0;
|
||||
clip_min = 0;
|
||||
|
||||
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
clip_max = 1;
|
||||
}
|
||||
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
clip_min = 1;
|
||||
}
|
||||
|
||||
|
||||
if (rectify) {
|
||||
|
||||
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
max = max * waveview->height;
|
||||
|
||||
|
||||
pymax = (int) rint ((item->y1 + waveview->height - max) * item->canvas->pixels_per_unit);
|
||||
pymin = (int) rint ((item->y1 + waveview->height) * item->canvas->pixels_per_unit);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
max = max * half_height;
|
||||
min = min * half_height;
|
||||
|
||||
|
||||
pymax = (int) rint ((item->y1 + origin - max) * item->canvas->pixels_per_unit);
|
||||
pymin = (int) rint ((item->y1 + origin - min) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
|
||||
/* OK, now fill the RGB buffer at x=i with a line between pymin and pymax,
|
||||
or, if samples_per_unit == 1, then a dot at each location.
|
||||
*/
|
||||
|
||||
|
||||
if (pymax == pymin) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin);
|
||||
} else {
|
||||
PAINT_VERTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax, pymin);
|
||||
}
|
||||
|
||||
|
||||
/* show clipped waveforms with small red lines */
|
||||
|
||||
|
||||
if (clip_max) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymax, pymax+clip_length);
|
||||
}
|
||||
|
||||
|
||||
if (clip_min) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymin-clip_length, pymin);
|
||||
}
|
||||
|
||||
/* presto, we're done */
|
||||
|
||||
|
||||
cache_index++;
|
||||
}
|
||||
}
|
||||
@@ -1609,7 +1609,7 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
||||
if (!waveview->rectified && waveview->zero_line) {
|
||||
// Paint zeroline.
|
||||
//PAINT_HORIZA(buf, waveview->zero_r, waveview->zero_g, waveview->zero_b, waveview->zero_a, begin, endi-1, origin );
|
||||
|
||||
|
||||
unsigned char zero_r, zero_g, zero_b, zero_a;
|
||||
UINT_TO_RGBA( waveview->zero_color, &zero_r, &zero_g, &zero_b, &zero_a );
|
||||
int zeroline_y = (int) rint ((item->y1 + origin) * item->canvas->pixels_per_unit);
|
||||
@@ -1718,7 +1718,7 @@ gnome_canvas_waveview_draw (GnomeCanvasItem *item,
|
||||
printf ("%p r (%d,%d)(%d,%d)[%d x %d] bbox (%d,%d)(%d,%d)[%d x %d]"
|
||||
" draw (%.1f,%.1f)(%.1f,%.1f)[%.1f x %.1f] s= %lu..%lu\n",
|
||||
waveview,
|
||||
x, y,
|
||||
x, y,
|
||||
x + width,
|
||||
y + height,
|
||||
width,
|
||||
@@ -1737,7 +1737,7 @@ gnome_canvas_waveview_draw (GnomeCanvasItem *item,
|
||||
#endif
|
||||
|
||||
/* draw the top half */
|
||||
|
||||
|
||||
for (xoff = ulx; xoff < lrx; xoff++) {
|
||||
double max, min;
|
||||
|
||||
@@ -1747,19 +1747,19 @@ gnome_canvas_waveview_draw (GnomeCanvasItem *item,
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
}
|
||||
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
}
|
||||
|
||||
|
||||
if (rectify) {
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
yoff = origin - (waveview->half_height * max) + 0.5;
|
||||
|
||||
|
||||
if (xoff == ulx) {
|
||||
/* first point */
|
||||
cairo_move_to (cr, xoff+0.5, yoff);
|
||||
@@ -1771,9 +1771,9 @@ gnome_canvas_waveview_draw (GnomeCanvasItem *item,
|
||||
}
|
||||
|
||||
/* from the final top point, move out of the clip zone */
|
||||
|
||||
|
||||
cairo_line_to (cr, xoff + 10, yoff);
|
||||
|
||||
|
||||
/* now draw the bottom half */
|
||||
|
||||
for (--xoff, --cache_index; xoff >= ulx; --xoff) {
|
||||
@@ -1794,23 +1794,23 @@ gnome_canvas_waveview_draw (GnomeCanvasItem *item,
|
||||
/* from the final lower point, move out of the clip zone */
|
||||
|
||||
cairo_line_to (cr, xoff - 10, yoff);
|
||||
|
||||
|
||||
/* close path to fill */
|
||||
|
||||
cairo_close_path (cr);
|
||||
|
||||
/* fill and stroke */
|
||||
|
||||
cairo_set_source_rgba (cr,
|
||||
(waveview->fill_r/255.0),
|
||||
(waveview->fill_g/255.0),
|
||||
(waveview->fill_b/255.0),
|
||||
cairo_set_source_rgba (cr,
|
||||
(waveview->fill_r/255.0),
|
||||
(waveview->fill_g/255.0),
|
||||
(waveview->fill_b/255.0),
|
||||
(waveview->fill_a/255.0));
|
||||
cairo_fill_preserve (cr);
|
||||
cairo_set_source_rgba (cr,
|
||||
(waveview->wave_r/255.0),
|
||||
(waveview->wave_g/255.0),
|
||||
(waveview->wave_b/255.0),
|
||||
cairo_set_source_rgba (cr,
|
||||
(waveview->wave_r/255.0),
|
||||
(waveview->wave_g/255.0),
|
||||
(waveview->wave_b/255.0),
|
||||
(waveview->wave_a/255.0));
|
||||
cairo_stroke (cr);
|
||||
|
||||
@@ -1827,13 +1827,13 @@ gnome_canvas_waveview_draw (GnomeCanvasItem *item,
|
||||
cairo_line_to (cr, xoff, yoff1 + clip_length);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
|
||||
if (clip_min) {
|
||||
cairo_move_to (cr, xoff, yoff2);
|
||||
cairo_line_to (cr, xoff, yoff2 - clip_length);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
@@ -1856,7 +1856,7 @@ gnome_canvas_waveview_bounds (GnomeCanvasItem *item, double *x1, double *y1, dou
|
||||
gnome_canvas_item_i2w (item, &x, &y);
|
||||
gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x, y, &c, &d);
|
||||
printf ("item bounds now (%g,%g),(%g,%g)\n", a, b, c, d);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -1869,8 +1869,8 @@ gnome_canvas_waveview_point (GnomeCanvasItem *item, double x, double y, int cx,
|
||||
(void) cx;
|
||||
(void) cy;
|
||||
(void) actual_item;
|
||||
|
||||
/* XXX for now, point is never inside the wave
|
||||
|
||||
/* XXX for now, point is never inside the wave
|
||||
GnomeCanvasWaveView *waveview;
|
||||
double x1, y1, x2, y2;
|
||||
double dx, dy;
|
||||
@@ -1888,7 +1888,7 @@ gnome_canvas_waveview_point (GnomeCanvasItem *item, double x, double y, int cx,
|
||||
gnome_canvas_waveview_bounds (item, &x1, &y1, &x2, &y2);
|
||||
|
||||
/* Is point inside rectangle */
|
||||
|
||||
|
||||
if ((x >= x1) && (y >= y1) && (x <= x2) && (y <= y2)) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct _GnomeCanvasWaveViewCache
|
||||
guint64 data_size;
|
||||
gulong start;
|
||||
gulong end;
|
||||
};
|
||||
};
|
||||
|
||||
GnomeCanvasWaveViewCache* gnome_canvas_waveview_cache_new ();
|
||||
void gnome_canvas_waveview_cache_destroy (GnomeCanvasWaveViewCache*);
|
||||
@@ -67,7 +67,7 @@ void gnome_canvas_waveview_cache_destroy (GnomeCanvasWaveView
|
||||
struct _GnomeCanvasWaveView
|
||||
{
|
||||
GnomeCanvasItem item;
|
||||
|
||||
|
||||
GnomeCanvasWaveViewCache *cache;
|
||||
gboolean cache_updater;
|
||||
gint screen_width;
|
||||
@@ -82,9 +82,9 @@ struct _GnomeCanvasWaveView
|
||||
|
||||
/** x-axis: samples per canvas unit. */
|
||||
double samples_per_unit;
|
||||
|
||||
|
||||
/** y-axis: amplitude_above_axis.
|
||||
*
|
||||
*
|
||||
* the default is that an (scaled, normalized -1.0 ... +1.0) amplitude of 1.0
|
||||
* corresponds to the top of the area assigned to the waveview.
|
||||
*
|
||||
@@ -107,7 +107,7 @@ struct _GnomeCanvasWaveView
|
||||
char rectified;
|
||||
char zero_line;
|
||||
char logscaled;
|
||||
|
||||
|
||||
/* These are updated by the update() routine
|
||||
to optimize the render() routine, which may
|
||||
be called several times after a single update().
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2002-2007 Paul Davis
|
||||
Copyright (C) 2002-2007 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
|
||||
@@ -76,7 +76,7 @@ ControlPoint::ControlPoint (const ControlPoint& other, bool /*dummy_arg_to_force
|
||||
_item->property_fill() = false;
|
||||
_item->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_ControlPointOutline.get();
|
||||
_item->property_outline_pixels() = 1;
|
||||
|
||||
|
||||
/* NOTE: no event handling in copied ControlPoints */
|
||||
|
||||
hide ();
|
||||
@@ -111,7 +111,7 @@ ControlPoint::set_visible (bool yn)
|
||||
{
|
||||
_item->property_draw() = (gboolean) yn;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ControlPoint::reset (double x, double y, AutomationList::iterator mi, uint32_t vi, ShapeType shape)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ ControlPoint::set_size (double sz)
|
||||
{
|
||||
_size = sz;
|
||||
|
||||
#if 0
|
||||
#if 0
|
||||
if (_size > 6.0) {
|
||||
item->property_fill() = (gboolean) TRUE;
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2002-2007 Paul Davis
|
||||
Copyright (C) 2002-2007 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
|
||||
@@ -42,7 +42,7 @@ namespace Gnome {
|
||||
}
|
||||
}
|
||||
|
||||
class ControlPoint
|
||||
class ControlPoint
|
||||
{
|
||||
public:
|
||||
ControlPoint (AutomationLine& al);
|
||||
@@ -54,13 +54,13 @@ class ControlPoint
|
||||
Start,
|
||||
End
|
||||
};
|
||||
|
||||
|
||||
void move_to (double x, double y, ShapeType);
|
||||
void reset (double x, double y, ARDOUR::AutomationList::iterator, uint32_t, ShapeType);
|
||||
double get_x() const { return _x; }
|
||||
double get_y() const { return _y; }
|
||||
|
||||
void hide ();
|
||||
void hide ();
|
||||
void show ();
|
||||
void show_color (bool entered, bool hide_too);
|
||||
|
||||
@@ -73,7 +73,7 @@ class ControlPoint
|
||||
void set_selected(bool yn) { _selected = yn; }
|
||||
uint32_t view_index() const { return _view_index; }
|
||||
void set_view_index(uint32_t i) { _view_index = i; }
|
||||
|
||||
|
||||
ARDOUR::AutomationList::iterator model() const { return _model; }
|
||||
AutomationLine& line() const { return _line; }
|
||||
ArdourCanvas::Item* item() const { return _item; }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2008 Paul Davis
|
||||
Copyright (C) 2000-2008 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
|
||||
@@ -36,9 +36,9 @@ ControlPointDialog::ControlPointDialog (ControlPoint* p)
|
||||
assert (point_);
|
||||
|
||||
double const y_fraction = 1.0 - (p->get_y () / p->line().height ());
|
||||
|
||||
|
||||
value_.set_text (p->line().fraction_to_string (y_fraction));
|
||||
|
||||
|
||||
Gtk::HBox* b = Gtk::manage (new Gtk::HBox ());
|
||||
|
||||
b->pack_start (*Gtk::manage (new Gtk::Label (_("Value"))));
|
||||
@@ -47,7 +47,7 @@ ControlPointDialog::ControlPointDialog (ControlPoint* p)
|
||||
if (p->line ().get_uses_gain_mapping ()) {
|
||||
b->pack_start (*Gtk::manage (new Gtk::Label (_("dB"))));
|
||||
}
|
||||
|
||||
|
||||
get_vbox ()->pack_end (*b);
|
||||
b->show_all ();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2008 Paul Davis
|
||||
Copyright (C) 2000-2008 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2004 Paul Davis
|
||||
Copyright (C) 2004 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
|
||||
@@ -85,7 +85,7 @@ CrossfadeEditor::CrossfadeEditor (Session& s, boost::shared_ptr<Crossfade> xf, d
|
||||
|
||||
preroll_button (_("With Pre-roll")),
|
||||
postroll_button (_("With Post-roll")),
|
||||
|
||||
|
||||
miny (my),
|
||||
maxy (mxy),
|
||||
|
||||
@@ -124,7 +124,7 @@ CrossfadeEditor::CrossfadeEditor (Session& s, boost::shared_ptr<Crossfade> xf, d
|
||||
canvas = new ArdourCanvas::CanvasAA ();
|
||||
canvas->signal_size_allocate().connect (mem_fun(*this, &CrossfadeEditor::canvas_allocation));
|
||||
canvas->set_size_request (425, 200);
|
||||
|
||||
|
||||
toplevel = new ArdourCanvas::SimpleRect (*(canvas->root()));
|
||||
toplevel->property_x1() = 0.0;
|
||||
toplevel->property_y1() = 0.0;
|
||||
@@ -134,21 +134,21 @@ CrossfadeEditor::CrossfadeEditor (Session& s, boost::shared_ptr<Crossfade> xf, d
|
||||
toplevel->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeEditorBase.get();
|
||||
toplevel->property_outline_pixels() = 0;
|
||||
toplevel->signal_event().connect (mem_fun (*this, &CrossfadeEditor::canvas_event));
|
||||
|
||||
|
||||
fade[Out].line = new ArdourCanvas::Line (*(canvas->root()));
|
||||
fade[Out].line->property_width_pixels() = 1;
|
||||
fade[Out].line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeEditorLine.get();
|
||||
|
||||
|
||||
fade[Out].shading = new ArdourCanvas::Polygon (*(canvas->root()));
|
||||
fade[Out].shading->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeEditorLineShading.get();
|
||||
|
||||
fade[In].line = new ArdourCanvas::Line (*(canvas->root()));
|
||||
fade[In].line->property_width_pixels() = 1;
|
||||
fade[In].line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeEditorLine.get();
|
||||
|
||||
|
||||
fade[In].shading = new ArdourCanvas::Polygon (*(canvas->root()));
|
||||
fade[In].shading->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeEditorLineShading.get();
|
||||
|
||||
|
||||
fade[In].shading->signal_event().connect (mem_fun (*this, &CrossfadeEditor::canvas_event));
|
||||
fade[In].line->signal_event().connect (mem_fun (*this, &CrossfadeEditor::curve_event));
|
||||
fade[Out].shading->signal_event().connect (mem_fun (*this, &CrossfadeEditor::canvas_event));
|
||||
@@ -161,7 +161,7 @@ CrossfadeEditor::CrossfadeEditor (Session& s, boost::shared_ptr<Crossfade> xf, d
|
||||
select_out_button.signal_clicked().connect (bind (mem_fun (*this, &CrossfadeEditor::curve_select_clicked), Out));
|
||||
|
||||
HBox* acbox = manage (new HBox);
|
||||
|
||||
|
||||
audition_box.set_border_width (7);
|
||||
audition_box.set_spacing (5);
|
||||
audition_box.set_homogeneous (false);
|
||||
@@ -172,7 +172,7 @@ CrossfadeEditor::CrossfadeEditor (Session& s, boost::shared_ptr<Crossfade> xf, d
|
||||
audition_box.pack_start (audition_right_dry_button, false, false);
|
||||
|
||||
Frame* audition_frame = manage (new Frame (_("Audition")));
|
||||
|
||||
|
||||
audition_frame->set_name (X_("CrossfadeEditFrame"));
|
||||
audition_frame->add (audition_box);
|
||||
|
||||
@@ -271,7 +271,7 @@ CrossfadeEditor::CrossfadeEditor (Session& s, boost::shared_ptr<Crossfade> xf, d
|
||||
curve_button_box.pack_start (fade_out_table, false, false, 12);
|
||||
curve_button_box.pack_start (*vpacker2, false, false, 12);
|
||||
curve_button_box.pack_start (fade_in_table, false, false, 12);
|
||||
|
||||
|
||||
get_vbox()->pack_start (*canvas_frame, true, true);
|
||||
get_vbox()->pack_start (curve_button_box, false, false);
|
||||
|
||||
@@ -339,7 +339,7 @@ CrossfadeEditor::set (const ARDOUR::AutomationList& curve, WhichFade which)
|
||||
for (list<Point*>::iterator i = fade[which].points.begin(); i != fade[which].points.end(); ++i) {
|
||||
delete *i;
|
||||
}
|
||||
|
||||
|
||||
fade[which].points.clear ();
|
||||
fade[which].gain_curve.clear ();
|
||||
fade[which].normative_curve.clear ();
|
||||
@@ -347,30 +347,30 @@ CrossfadeEditor::set (const ARDOUR::AutomationList& curve, WhichFade which)
|
||||
if (curve.empty()) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
the_end = curve.end();
|
||||
--the_end;
|
||||
|
||||
|
||||
firstx = (*curve.begin())->when;
|
||||
endx = (*the_end)->when;
|
||||
|
||||
for (ARDOUR::AutomationList::const_iterator i = curve.begin(); i != curve.end(); ++i) {
|
||||
|
||||
|
||||
double xfract = ((*i)->when - firstx) / (endx - firstx);
|
||||
double yfract = ((*i)->value - miny) / (maxy - miny);
|
||||
|
||||
|
||||
Point* p = make_point ();
|
||||
|
||||
p->move_to (x_coordinate (xfract), y_coordinate (yfract),
|
||||
xfract, yfract);
|
||||
|
||||
|
||||
fade[which].points.push_back (p);
|
||||
}
|
||||
|
||||
/* no need to sort because curve is already time-ordered */
|
||||
|
||||
out:
|
||||
|
||||
|
||||
swap (which, current);
|
||||
redraw ();
|
||||
swap (which, current);
|
||||
@@ -402,7 +402,7 @@ CrossfadeEditor::point_event (GdkEvent* event, Point* point)
|
||||
if (Keyboard::is_delete_event (&event->button)) {
|
||||
fade[current].points.remove (point);
|
||||
delete point;
|
||||
}
|
||||
}
|
||||
|
||||
redraw ();
|
||||
break;
|
||||
@@ -420,7 +420,7 @@ CrossfadeEditor::point_event (GdkEvent* event, Point* point)
|
||||
}
|
||||
|
||||
new_y = 1.0 - ((event->motion.y - canvas_border)/effective_height());
|
||||
point->move_to (x_coordinate (new_x), y_coordinate (new_y),
|
||||
point->move_to (x_coordinate (new_x), y_coordinate (new_y),
|
||||
new_x, new_y);
|
||||
redraw ();
|
||||
}
|
||||
@@ -465,7 +465,7 @@ CrossfadeEditor::make_point ()
|
||||
p->curve = fade[current].line;
|
||||
|
||||
p->box->signal_event().connect (bind (mem_fun (*this, &CrossfadeEditor::point_event), p));
|
||||
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -475,12 +475,12 @@ CrossfadeEditor::add_control_point (double x, double y)
|
||||
PointSorter cmp;
|
||||
|
||||
/* enforce end point x location */
|
||||
|
||||
|
||||
if (fade[current].points.empty()) {
|
||||
x = 0.0;
|
||||
} else if (fade[current].points.size() == 1) {
|
||||
x = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
Point* p = make_point ();
|
||||
|
||||
@@ -518,9 +518,9 @@ CrossfadeEditor::canvas_allocation (Gtk::Allocation& /*alloc*/)
|
||||
toplevel->property_x2() = (double) canvas->get_allocation().get_width() + canvas_border;
|
||||
toplevel->property_y2() = (double) canvas->get_allocation().get_height() + canvas_border;
|
||||
}
|
||||
|
||||
canvas->set_scroll_region (0.0, 0.0,
|
||||
canvas->get_allocation().get_width(),
|
||||
|
||||
canvas->set_scroll_region (0.0, 0.0,
|
||||
canvas->get_allocation().get_width(),
|
||||
canvas->get_allocation().get_height());
|
||||
|
||||
Point* end = make_point ();
|
||||
@@ -547,9 +547,9 @@ CrossfadeEditor::canvas_allocation (Gtk::Allocation& /*alloc*/)
|
||||
(*i)->move_to (x_coordinate((*i)->x), y_coordinate((*i)->y),
|
||||
(*i)->x, (*i)->y);
|
||||
}
|
||||
|
||||
|
||||
end = make_point ();
|
||||
|
||||
|
||||
if (fade[Out].points.size() > 1) {
|
||||
Point* old_end = fade[Out].points.back();
|
||||
fade[Out].points.pop_back ();
|
||||
@@ -572,7 +572,7 @@ CrossfadeEditor::canvas_allocation (Gtk::Allocation& /*alloc*/)
|
||||
y_coordinate ((*i)->y),
|
||||
(*i)->x, (*i)->y);
|
||||
}
|
||||
|
||||
|
||||
WhichFade old_current = current;
|
||||
current = In;
|
||||
redraw ();
|
||||
@@ -655,7 +655,7 @@ CrossfadeEditor::redraw ()
|
||||
float vec[npoints];
|
||||
|
||||
fade[current].normative_curve.curve().get_vector (0, 1.0, vec, npoints);
|
||||
|
||||
|
||||
ArdourCanvas::Points pts;
|
||||
ArdourCanvas::Points spts;
|
||||
|
||||
@@ -687,11 +687,11 @@ CrossfadeEditor::redraw ()
|
||||
spts[2].set_x (effective_width() + canvas_border);
|
||||
spts[2].set_y (canvas_border);
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
/* upper left */
|
||||
|
||||
|
||||
spts[0].set_x (canvas_border);
|
||||
spts[0].set_y (canvas_border);
|
||||
|
||||
@@ -712,7 +712,7 @@ CrossfadeEditor::redraw ()
|
||||
for (size_t i = 0; i < npoints; ++i) {
|
||||
|
||||
double y = vec[i];
|
||||
|
||||
|
||||
pts[i].set_x (canvas_border + i);
|
||||
pts[i].set_y (y_coordinate (y));
|
||||
|
||||
@@ -731,20 +731,20 @@ CrossfadeEditor::redraw ()
|
||||
void
|
||||
CrossfadeEditor::apply_preset (Preset *preset)
|
||||
{
|
||||
|
||||
|
||||
WhichFade wf = find(fade_in_presets->begin(), fade_in_presets->end(), preset) != fade_in_presets->end() ? In : Out;
|
||||
|
||||
|
||||
if (current != wf) {
|
||||
|
||||
|
||||
if (wf == In) {
|
||||
select_in_button.clicked();
|
||||
} else {
|
||||
select_out_button.clicked();
|
||||
}
|
||||
|
||||
|
||||
curve_select_clicked (wf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (list<Point*>::iterator i = fade[current].points.begin(); i != fade[current].points.end(); ++i) {
|
||||
delete *i;
|
||||
}
|
||||
@@ -910,7 +910,7 @@ CrossfadeEditor::build_presets ()
|
||||
p->push_back (PresetPoint (0.976959, 0.697222));
|
||||
p->push_back (PresetPoint (1, 1));
|
||||
fade_in_presets->push_back (p);
|
||||
|
||||
|
||||
p = new Preset ("Slow cut", "crossfade-in-slow-cut");
|
||||
p->push_back (PresetPoint (0, 0));
|
||||
p->push_back (PresetPoint (0.304147, 0.0694444));
|
||||
@@ -920,7 +920,7 @@ CrossfadeEditor::build_presets ()
|
||||
p->push_back (PresetPoint (0.919355, 0.730556));
|
||||
p->push_back (PresetPoint (1, 1));
|
||||
fade_in_presets->push_back (p);
|
||||
|
||||
|
||||
p = new Preset ("Fast cut", "crossfade-in-fast-cut");
|
||||
p->push_back (PresetPoint (0, 0));
|
||||
p->push_back (PresetPoint (0.0737327, 0.308333));
|
||||
@@ -942,7 +942,7 @@ CrossfadeEditor::build_presets ()
|
||||
p->push_back (PresetPoint (1, 1));
|
||||
fade_in_presets->push_back (p);
|
||||
}
|
||||
|
||||
|
||||
/* FADE OUT */
|
||||
|
||||
// p = new Preset ("regout.xpm");
|
||||
@@ -985,7 +985,7 @@ CrossfadeEditor::build_presets ()
|
||||
p->push_back (PresetPoint (0.833333, 0.282192));
|
||||
p->push_back (PresetPoint (1.000000, 0.000000));
|
||||
fade_out_presets->push_back (p);
|
||||
|
||||
|
||||
if (!Profile->get_sae()) {
|
||||
// p = new Preset ("hiout.xpm");
|
||||
p = new Preset ("Short cut", "crossfade-out-short-cut");
|
||||
@@ -997,7 +997,7 @@ CrossfadeEditor::build_presets ()
|
||||
p->push_back (PresetPoint (0.976852, 0.22865));
|
||||
p->push_back (PresetPoint (1, 0));
|
||||
fade_out_presets->push_back (p);
|
||||
|
||||
|
||||
p = new Preset ("Slow cut", "crossfade-out-slow-cut");
|
||||
p->push_back (PresetPoint (0, 1));
|
||||
p->push_back (PresetPoint (0.228111, 0.988889));
|
||||
@@ -1007,7 +1007,7 @@ CrossfadeEditor::build_presets ()
|
||||
p->push_back (PresetPoint (0.9262673, 0.308333));
|
||||
p->push_back (PresetPoint (1, 0));
|
||||
fade_out_presets->push_back (p);
|
||||
|
||||
|
||||
p = new Preset ("Fast cut", "crossfade-out-fast-cut");
|
||||
p->push_back (PresetPoint (0, 1));
|
||||
p->push_back (PresetPoint (0.080645, 0.730556));
|
||||
@@ -1016,7 +1016,7 @@ CrossfadeEditor::build_presets ()
|
||||
p->push_back (PresetPoint (0.695853, 0.0694444));
|
||||
p->push_back (PresetPoint (1, 0));
|
||||
fade_out_presets->push_back (p);
|
||||
|
||||
|
||||
// p = new Preset ("loout.xpm");
|
||||
p = new Preset ("Long cut", "crossfade-out-long-cut");
|
||||
p->push_back (PresetPoint (0, 1));
|
||||
@@ -1027,7 +1027,7 @@ CrossfadeEditor::build_presets ()
|
||||
p->push_back (PresetPoint (0.610599, 0.0333333));
|
||||
p->push_back (PresetPoint (1, 0));
|
||||
fade_out_presets->push_back (p);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1035,9 +1035,9 @@ void
|
||||
CrossfadeEditor::curve_select_clicked (WhichFade wf)
|
||||
{
|
||||
current = wf;
|
||||
|
||||
|
||||
if (wf == In) {
|
||||
|
||||
|
||||
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[In].waves.begin(); i != fade[In].waves.end(); ++i) {
|
||||
(*i)->property_wave_color() = ARDOUR_UI::config()->canvasvar_SelectedCrossfadeEditorWave.get();
|
||||
(*i)->property_fill_color() = ARDOUR_UI::config()->canvasvar_SelectedCrossfadeEditorWave.get();
|
||||
@@ -1081,7 +1081,7 @@ CrossfadeEditor::curve_select_clicked (WhichFade wf)
|
||||
for (list<Point*>::iterator i = fade[In].points.begin(); i != fade[In].points.end(); ++i) {
|
||||
(*i)->box->hide();
|
||||
}
|
||||
|
||||
|
||||
for (list<Point*>::iterator i = fade[Out].points.begin(); i != fade[Out].points.end(); ++i) {
|
||||
(*i)->box->show();
|
||||
}
|
||||
@@ -1089,7 +1089,7 @@ CrossfadeEditor::curve_select_clicked (WhichFade wf)
|
||||
}
|
||||
}
|
||||
|
||||
double
|
||||
double
|
||||
CrossfadeEditor::x_coordinate (double& xfract) const
|
||||
{
|
||||
xfract = min (1.0, xfract);
|
||||
@@ -1125,9 +1125,9 @@ CrossfadeEditor::make_waves (boost::shared_ptr<AudioRegion> region, WhichFade wh
|
||||
spu = xfade->length() / (double) effective_width();
|
||||
|
||||
for (uint32_t n = 0; n < nchans; ++n) {
|
||||
|
||||
|
||||
gdouble yoff = n * ht;
|
||||
|
||||
|
||||
if (region->audio_source(n)->peaks_ready (bind (mem_fun(*this, &CrossfadeEditor::peaks_ready), region, which), peaks_ready_connection)) {
|
||||
WaveView* waveview = new WaveView (*(canvas->root()));
|
||||
|
||||
@@ -1147,7 +1147,7 @@ CrossfadeEditor::make_waves (boost::shared_ptr<AudioRegion> region, WhichFade wh
|
||||
waveview->property_amplitude_above_axis() = 2.0;
|
||||
waveview->property_wave_color() = color;
|
||||
waveview->property_fill_color() = color;
|
||||
|
||||
|
||||
if (which==In)
|
||||
waveview->property_region_start() = region->start();
|
||||
else
|
||||
@@ -1212,11 +1212,11 @@ CrossfadeEditor::audition (Audition which)
|
||||
right_length = xfade->in()->length();
|
||||
}
|
||||
|
||||
boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), left_start_offset, left_length, "xfade out",
|
||||
boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), left_start_offset, left_length, "xfade out",
|
||||
0, Region::DefaultFlags, false)));
|
||||
boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->in(), 0, right_length, "xfade in",
|
||||
boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->in(), 0, right_length, "xfade in",
|
||||
0, Region::DefaultFlags, false)));
|
||||
|
||||
|
||||
//apply a 20ms declicking fade at the start and end of auditioning
|
||||
left->set_fade_in_active(true);
|
||||
left->set_fade_in_length(session.frame_rate() / 50);
|
||||
@@ -1225,7 +1225,7 @@ CrossfadeEditor::audition (Audition which)
|
||||
|
||||
pl.add_region (left, 0);
|
||||
pl.add_region (right, 1 + preroll);
|
||||
|
||||
|
||||
if (which == Left) {
|
||||
right->set_scale_amplitude (0.0);
|
||||
} else if (which == Right) {
|
||||
@@ -1247,9 +1247,9 @@ CrossfadeEditor::audition_both ()
|
||||
void
|
||||
CrossfadeEditor::audition_left_dry ()
|
||||
{
|
||||
boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), xfade->out()->length() - xfade->length(), xfade->length(), "xfade left",
|
||||
boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), xfade->out()->length() - xfade->length(), xfade->length(), "xfade left",
|
||||
0, Region::DefaultFlags, false)));
|
||||
|
||||
|
||||
session.audition_region (left);
|
||||
}
|
||||
|
||||
@@ -1262,7 +1262,7 @@ CrossfadeEditor::audition_left ()
|
||||
void
|
||||
CrossfadeEditor::audition_right_dry ()
|
||||
{
|
||||
boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->in(), 0, xfade->length(), "xfade in",
|
||||
boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->in(), 0, xfade->length(), "xfade in",
|
||||
0, Region::DefaultFlags, false)));
|
||||
session.audition_region (right);
|
||||
}
|
||||
@@ -1272,7 +1272,7 @@ CrossfadeEditor::audition_right ()
|
||||
{
|
||||
audition (Right);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CrossfadeEditor::cancel_audition ()
|
||||
{
|
||||
@@ -1298,7 +1298,7 @@ void
|
||||
CrossfadeEditor::audition_right_toggled ()
|
||||
{
|
||||
bool x;
|
||||
|
||||
|
||||
if ((x = audition_right_button.get_active ()) != session.is_auditioning()) {
|
||||
|
||||
if (x) {
|
||||
@@ -1345,7 +1345,7 @@ CrossfadeEditor::audition_left_dry_toggled ()
|
||||
bool x;
|
||||
|
||||
if ((x = audition_left_dry_button.get_active ()) != session.is_auditioning()) {
|
||||
|
||||
|
||||
if (x) {
|
||||
audition_left_dry ();
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -42,69 +42,69 @@ class CrossfadeEditor : public ArdourDialog
|
||||
public:
|
||||
CrossfadeEditor (ARDOUR::Session&, boost::shared_ptr<ARDOUR::Crossfade>, double miny, double maxy);
|
||||
~CrossfadeEditor ();
|
||||
|
||||
|
||||
void apply ();
|
||||
|
||||
|
||||
static const double canvas_border;
|
||||
|
||||
|
||||
/* these are public so that a caller/subclass can make them do the right thing.
|
||||
*/
|
||||
|
||||
|
||||
Gtk::Button* cancel_button;
|
||||
Gtk::Button* ok_button;
|
||||
|
||||
|
||||
struct PresetPoint {
|
||||
double x;
|
||||
double y;
|
||||
|
||||
PresetPoint (double a, double b)
|
||||
|
||||
PresetPoint (double a, double b)
|
||||
: x (a), y (b) {}
|
||||
};
|
||||
|
||||
|
||||
struct Preset : public std::list<PresetPoint> {
|
||||
const char* name;
|
||||
const char* image_name;
|
||||
|
||||
Preset (const char* n, const char* x) : name (n), image_name (x) {}
|
||||
};
|
||||
|
||||
|
||||
typedef std::list<Preset*> Presets;
|
||||
|
||||
|
||||
static Presets* fade_in_presets;
|
||||
static Presets* fade_out_presets;
|
||||
|
||||
protected:
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
bool on_key_release_event (GdkEventKey*);
|
||||
|
||||
|
||||
private:
|
||||
boost::shared_ptr<ARDOUR::Crossfade> xfade;
|
||||
ARDOUR::Session& session;
|
||||
|
||||
|
||||
Gtk::VBox vpacker;
|
||||
|
||||
|
||||
struct Point {
|
||||
~Point();
|
||||
|
||||
|
||||
ArdourCanvas::SimpleRect* box;
|
||||
ArdourCanvas::Line* curve;
|
||||
double x;
|
||||
double y;
|
||||
|
||||
|
||||
static const int32_t size;
|
||||
|
||||
|
||||
void move_to (double x, double y, double xfract, double yfract);
|
||||
};
|
||||
|
||||
|
||||
struct PointSorter {
|
||||
bool operator() (const CrossfadeEditor::Point* a, const CrossfadeEditor::Point *b) {
|
||||
return a->x < b->x;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
ArdourCanvas::SimpleRect* toplevel;
|
||||
ArdourCanvas::Canvas* canvas;
|
||||
|
||||
|
||||
struct Half {
|
||||
ArdourCanvas::Line* line;
|
||||
ArdourCanvas::Polygon* shading;
|
||||
@@ -112,18 +112,18 @@ class CrossfadeEditor : public ArdourDialog
|
||||
ARDOUR::AutomationList normative_curve; /* 0 - 1.0, linear */
|
||||
ARDOUR::AutomationList gain_curve; /* 0 - 2.0, gain mapping */
|
||||
std::vector<ArdourCanvas::WaveView*> waves;
|
||||
|
||||
|
||||
Half();
|
||||
};
|
||||
|
||||
|
||||
enum WhichFade {
|
||||
In = 0,
|
||||
Out = 1
|
||||
};
|
||||
|
||||
|
||||
Half fade[2];
|
||||
WhichFade current;
|
||||
|
||||
|
||||
bool point_grabbed;
|
||||
std::vector<Gtk::Button*> fade_out_buttons;
|
||||
std::vector<Gtk::Button*> fade_in_buttons;
|
||||
@@ -154,7 +154,7 @@ class CrossfadeEditor : public ArdourDialog
|
||||
void add_control_point (double x, double y);
|
||||
Point* make_point ();
|
||||
void redraw ();
|
||||
|
||||
|
||||
double effective_width () const { return canvas->get_allocation().get_width() - (2.0 * canvas_border); }
|
||||
double effective_height () const { return canvas->get_allocation().get_height() - (2.0 * canvas_border); }
|
||||
|
||||
@@ -169,7 +169,7 @@ class CrossfadeEditor : public ArdourDialog
|
||||
|
||||
void build_presets ();
|
||||
void apply_preset (Preset*);
|
||||
|
||||
|
||||
Gtk::RadioButton select_in_button;
|
||||
Gtk::RadioButton select_out_button;
|
||||
Gtk::HBox curve_button_box;
|
||||
@@ -179,25 +179,25 @@ class CrossfadeEditor : public ArdourDialog
|
||||
|
||||
double x_coordinate (double& xfract) const;
|
||||
double y_coordinate (double& yfract) const;
|
||||
|
||||
|
||||
void set (const ARDOUR::AutomationList& alist, WhichFade);
|
||||
|
||||
sigc::connection peaks_ready_connection;
|
||||
|
||||
void make_waves (boost::shared_ptr<ARDOUR::AudioRegion>, WhichFade);
|
||||
void peaks_ready (boost::shared_ptr<ARDOUR::AudioRegion> r, WhichFade);
|
||||
|
||||
|
||||
void _apply_to (boost::shared_ptr<ARDOUR::Crossfade> xf);
|
||||
void setup (boost::shared_ptr<ARDOUR::Crossfade>);
|
||||
void cancel_audition ();
|
||||
void audition_state_changed (bool);
|
||||
|
||||
|
||||
enum Audition {
|
||||
Both,
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
|
||||
|
||||
void audition_toggled ();
|
||||
void audition_right_toggled ();
|
||||
void audition_right_dry_toggled ();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2003 Paul Davis
|
||||
Copyright (C) 2003 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
|
||||
@@ -42,21 +42,21 @@ using namespace Canvas;
|
||||
|
||||
sigc::signal<void,CrossfadeView*> CrossfadeView::GoingAway;
|
||||
|
||||
CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
||||
RouteTimeAxisView &tv,
|
||||
boost::shared_ptr<Crossfade> xf,
|
||||
CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
||||
RouteTimeAxisView &tv,
|
||||
boost::shared_ptr<Crossfade> xf,
|
||||
double spu,
|
||||
Gdk::Color& basic_color,
|
||||
AudioRegionView& lview,
|
||||
AudioRegionView& rview)
|
||||
|
||||
|
||||
: TimeAxisViewItem ("xfade" /*xf.name()*/, *parent, tv, spu, basic_color, xf->position(),
|
||||
|
||||
: TimeAxisViewItem ("xfade" /*xf.name()*/, *parent, tv, spu, basic_color, xf->position(),
|
||||
xf->length(), false, TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)),
|
||||
crossfade (xf),
|
||||
left_view (lview),
|
||||
right_view (rview)
|
||||
|
||||
|
||||
{
|
||||
_valid = true;
|
||||
_visible = true;
|
||||
@@ -68,7 +68,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
||||
fade_out = new Line (*group);
|
||||
fade_out->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeLine.get();
|
||||
fade_out->property_width_pixels() = 1;
|
||||
|
||||
|
||||
set_height (get_time_axis_view().current_height());
|
||||
|
||||
/* no frame around the xfade or overlap rects */
|
||||
@@ -79,9 +79,9 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
||||
|
||||
vestigial_frame->hide();
|
||||
show_vestigial = false;
|
||||
|
||||
|
||||
group->signal_event().connect (bind (mem_fun (tv.editor(), &PublicEditor::canvas_crossfade_view_event), group, this));
|
||||
|
||||
|
||||
crossfade_changed (Change (~0));
|
||||
|
||||
crossfade->StateChanged.connect (mem_fun(*this, &CrossfadeView::crossfade_changed));
|
||||
@@ -139,7 +139,7 @@ CrossfadeView::crossfade_changed (Change what_changed)
|
||||
if (what_changed & Crossfade::FollowOverlapChanged) {
|
||||
need_redraw_curves = true;
|
||||
}
|
||||
|
||||
|
||||
if (what_changed & Crossfade::ActiveChanged) {
|
||||
/* calls redraw_curves */
|
||||
active_changed ();
|
||||
@@ -151,7 +151,7 @@ CrossfadeView::crossfade_changed (Change what_changed)
|
||||
void
|
||||
CrossfadeView::redraw_curves ()
|
||||
{
|
||||
Points* points;
|
||||
Points* points;
|
||||
int32_t npoints;
|
||||
float* vec;
|
||||
|
||||
@@ -177,7 +177,7 @@ CrossfadeView::redraw_curves ()
|
||||
} else {
|
||||
fade_in->show();
|
||||
fade_out->show();
|
||||
}
|
||||
}
|
||||
|
||||
points = get_canvas_points ("xfade edit redraw", npoints);
|
||||
vec = new float[npoints];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2003 Paul Davis
|
||||
Copyright (C) 2003 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
|
||||
@@ -32,10 +32,10 @@ class AudioRegionView;
|
||||
|
||||
struct CrossfadeView : public TimeAxisViewItem
|
||||
{
|
||||
CrossfadeView (ArdourCanvas::Group*,
|
||||
CrossfadeView (ArdourCanvas::Group*,
|
||||
RouteTimeAxisView&,
|
||||
boost::shared_ptr<ARDOUR::Crossfade>,
|
||||
double initial_samples_per_unit,
|
||||
double initial_samples_per_unit,
|
||||
Gdk::Color& basic_color,
|
||||
AudioRegionView& leftview,
|
||||
AudioRegionView& rightview);
|
||||
@@ -59,7 +59,7 @@ struct CrossfadeView : public TimeAxisViewItem
|
||||
void fake_hide ();
|
||||
void hide ();
|
||||
void show ();
|
||||
|
||||
|
||||
protected:
|
||||
void reset_width_dependent_items (double pixel_width);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -50,7 +50,7 @@ curvetest (string filename)
|
||||
|
||||
in >> x;
|
||||
in >> y;
|
||||
|
||||
|
||||
if (!in) {
|
||||
break;
|
||||
}
|
||||
@@ -58,11 +58,11 @@ curvetest (string filename)
|
||||
if (x < minx) {
|
||||
minx = x;
|
||||
}
|
||||
|
||||
|
||||
if (x > maxx) {
|
||||
maxx = x;
|
||||
}
|
||||
|
||||
|
||||
al.add (x, y);
|
||||
}
|
||||
|
||||
@@ -70,10 +70,10 @@ curvetest (string filename)
|
||||
float foo[1024];
|
||||
|
||||
al.curve().get_vector (minx, maxx, foo, 1024);
|
||||
|
||||
|
||||
for (int i = 0; i < 1024; ++i) {
|
||||
cout << minx + (((double) i / 1024.0) * (maxx - minx)) << ' ' << foo[i] << endl;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Author: Dave Robillard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -59,7 +59,7 @@ Diamond::move_to (double x, double y)
|
||||
|
||||
points->coords[4] = _x;
|
||||
points->coords[5] = _y;
|
||||
|
||||
|
||||
points->coords[6] = _x - _h;
|
||||
points->coords[7] = _y + _h;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Copyright (C) 2007 Paul Davis
|
||||
Author: Dave Robillard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -28,7 +28,7 @@ namespace Gnome {
|
||||
namespace Canvas {
|
||||
|
||||
|
||||
class Diamond : public Polygon
|
||||
class Diamond : public Polygon
|
||||
{
|
||||
public:
|
||||
Diamond(Group& group, double height);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2003 Paul Davis
|
||||
Copyright (C) 2000-2003 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
|
||||
@@ -138,10 +138,10 @@ struct EditorCursor {
|
||||
ArdourCanvas::Line canvas_item;
|
||||
nframes64_t current_frame;
|
||||
double length;
|
||||
|
||||
|
||||
EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
|
||||
~EditorCursor ();
|
||||
|
||||
|
||||
void set_position (nframes64_t);
|
||||
void set_length (double units);
|
||||
void set_y_axis (double position);
|
||||
@@ -154,7 +154,7 @@ class Editor : public PublicEditor
|
||||
public:
|
||||
Editor ();
|
||||
~Editor ();
|
||||
|
||||
|
||||
void connect_to_session (ARDOUR::Session *);
|
||||
ARDOUR::Session* current_session() const { return session; }
|
||||
void first_idle ();
|
||||
@@ -165,7 +165,7 @@ class Editor : public PublicEditor
|
||||
nframes64_t current_page_frames() const {
|
||||
return (nframes64_t) floor (_canvas_width * frames_per_unit);
|
||||
}
|
||||
|
||||
|
||||
double canvas_height () const {
|
||||
return _canvas_height;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ class Editor : public PublicEditor
|
||||
|
||||
void set_show_waveforms_recording (bool yn);
|
||||
bool show_waveforms_recording() const { return _show_waveforms_recording; }
|
||||
|
||||
|
||||
/* things that need to be public to be used in the main menubar */
|
||||
|
||||
void new_region_from_selection ();
|
||||
@@ -232,7 +232,7 @@ class Editor : public PublicEditor
|
||||
nframes64_t unit_to_frame (double unit) const {
|
||||
return (nframes64_t) rint (unit * frames_per_unit);
|
||||
}
|
||||
|
||||
|
||||
double frame_to_unit (nframes64_t frame) const {
|
||||
return rint ((double) frame / (double) frames_per_unit);
|
||||
}
|
||||
@@ -245,11 +245,11 @@ class Editor : public PublicEditor
|
||||
the result of using the world->canvas affine transform on a
|
||||
world coordinate. These coordinates already take into
|
||||
account any scrolling carried out by adjusting the
|
||||
xscroll_adjustment.
|
||||
xscroll_adjustment.
|
||||
*/
|
||||
|
||||
nframes64_t pixel_to_frame (double pixel) const {
|
||||
|
||||
|
||||
/* pixel can be less than zero when motion events
|
||||
are processed. since we've already run the world->canvas
|
||||
affine, that means that the location *really* is "off
|
||||
@@ -282,7 +282,7 @@ class Editor : public PublicEditor
|
||||
void invert_selection_in_track ();
|
||||
void invert_selection ();
|
||||
void deselect_all ();
|
||||
|
||||
|
||||
void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
|
||||
|
||||
/* tempo */
|
||||
@@ -296,7 +296,7 @@ class Editor : public PublicEditor
|
||||
void analyze_range_selection();
|
||||
|
||||
/* export */
|
||||
|
||||
|
||||
void export_audio ();
|
||||
void export_selection ();
|
||||
void export_range ();
|
||||
@@ -346,7 +346,7 @@ class Editor : public PublicEditor
|
||||
void nudge_backward_capture_offset ();
|
||||
|
||||
/* playhead/screen stuff */
|
||||
|
||||
|
||||
void set_follow_playhead (bool yn);
|
||||
void toggle_follow_playhead ();
|
||||
bool follow_playhead() const { return _follow_playhead; }
|
||||
@@ -422,7 +422,7 @@ class Editor : public PublicEditor
|
||||
|
||||
void show_verbose_canvas_cursor_with (const std::string& txt);
|
||||
void hide_verbose_canvas_cursor();
|
||||
|
||||
|
||||
protected:
|
||||
void map_transport_state ();
|
||||
void map_position_change (nframes64_t);
|
||||
@@ -432,13 +432,13 @@ class Editor : public PublicEditor
|
||||
private:
|
||||
|
||||
void color_handler ();
|
||||
|
||||
|
||||
ARDOUR::Session *session; ///< The session that we are editing, or 0
|
||||
bool constructed;
|
||||
|
||||
// to keep track of the playhead position for control_scroll
|
||||
boost::optional<nframes64_t> _control_scroll_target;
|
||||
|
||||
|
||||
PlaylistSelector* _playlist_selector;
|
||||
|
||||
typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
|
||||
@@ -451,7 +451,7 @@ class Editor : public PublicEditor
|
||||
bool zoomed_to_region;
|
||||
std::list<TAVState> track_states;
|
||||
};
|
||||
|
||||
|
||||
std::list<VisualState*> undo_visual_stack;
|
||||
std::list<VisualState*> redo_visual_stack;
|
||||
VisualState* current_visual_state (bool with_tracks = true);
|
||||
@@ -460,7 +460,7 @@ class Editor : public PublicEditor
|
||||
void use_visual_state (VisualState&);
|
||||
bool no_save_visual;
|
||||
void swap_visual_state ();
|
||||
|
||||
|
||||
std::vector<VisualState*> visual_states;
|
||||
sigc::connection visual_state_op_connection;
|
||||
void start_visual_state_op (uint32_t n);
|
||||
@@ -476,7 +476,7 @@ class Editor : public PublicEditor
|
||||
|
||||
Editing::MouseMode mouse_mode;
|
||||
bool _internal_editing;
|
||||
|
||||
|
||||
int post_maximal_editor_width;
|
||||
int post_maximal_pane_position;
|
||||
int pre_maximal_pane_position;
|
||||
@@ -515,7 +515,7 @@ class Editor : public PublicEditor
|
||||
bool valid;
|
||||
|
||||
LocationMarkers () : start(0), end(0), valid (true) {}
|
||||
|
||||
|
||||
~LocationMarkers ();
|
||||
|
||||
void hide();
|
||||
@@ -575,7 +575,7 @@ class Editor : public PublicEditor
|
||||
|
||||
void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void select_all_tracks ();
|
||||
|
||||
|
||||
bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void set_selected_track_as_side_effect (bool force = false);
|
||||
@@ -584,7 +584,7 @@ class Editor : public PublicEditor
|
||||
bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
|
||||
void collect_new_region_view (RegionView *);
|
||||
void collect_and_select_new_region_view (RegionView *);
|
||||
|
||||
|
||||
Gtk::Menu track_context_menu;
|
||||
Gtk::Menu track_region_context_menu;
|
||||
Gtk::Menu track_selection_context_menu;
|
||||
@@ -626,7 +626,7 @@ class Editor : public PublicEditor
|
||||
bool verbose_cursor_visible;
|
||||
|
||||
void parameter_changed (std::string);
|
||||
|
||||
|
||||
bool track_canvas_motion (GdkEvent*);
|
||||
|
||||
void set_verbose_canvas_cursor (const std::string &, double x, double y);
|
||||
@@ -664,20 +664,20 @@ class Editor : public PublicEditor
|
||||
|
||||
/** The group containing all items that require horizontal scrolling. */
|
||||
ArdourCanvas::Group* _background_group;
|
||||
/*
|
||||
/*
|
||||
The _master_group is the group containing all items
|
||||
that require horizontal scrolling..
|
||||
It is primarily used to separate canvas items
|
||||
that require horizontal scrolling from those that do not.
|
||||
It is primarily used to separate canvas items
|
||||
that require horizontal scrolling from those that do not.
|
||||
*/
|
||||
ArdourCanvas::Group* _master_group;
|
||||
|
||||
/* The group containing all trackviews. Only scrolled vertically. */
|
||||
ArdourCanvas::Group* _trackview_group;
|
||||
|
||||
|
||||
/* The group used for region motion. Sits on top of _trackview_group */
|
||||
ArdourCanvas::Group* _region_motion_group;
|
||||
|
||||
|
||||
enum RulerType {
|
||||
ruler_metric_smpte = 0,
|
||||
ruler_metric_bbt = 1,
|
||||
@@ -704,19 +704,19 @@ class Editor : public PublicEditor
|
||||
Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
|
||||
bool no_ruler_shown_update;
|
||||
|
||||
|
||||
gint ruler_button_press (GdkEventButton*);
|
||||
gint ruler_button_release (GdkEventButton*);
|
||||
gint ruler_mouse_motion (GdkEventMotion*);
|
||||
bool ruler_scroll (GdkEventScroll* event);
|
||||
|
||||
Gtk::Widget * ruler_grabbed_widget;
|
||||
|
||||
|
||||
void initialize_rulers ();
|
||||
void update_just_smpte ();
|
||||
void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
|
||||
void update_fixed_rulers ();
|
||||
void update_tempo_based_rulers ();
|
||||
void update_tempo_based_rulers ();
|
||||
void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem);
|
||||
void update_ruler_visibility ();
|
||||
void set_ruler_visible (RulerType, bool);
|
||||
@@ -725,12 +725,12 @@ class Editor : public PublicEditor
|
||||
gint ruler_label_button_release (GdkEventButton*);
|
||||
void store_ruler_visibility ();
|
||||
void restore_ruler_visibility ();
|
||||
|
||||
|
||||
static gint _metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
|
||||
|
||||
|
||||
enum MinsecRulerScale {
|
||||
minsec_show_seconds,
|
||||
minsec_show_minutes,
|
||||
@@ -801,14 +801,14 @@ class Editor : public PublicEditor
|
||||
gdouble canvas_timebars_vsize;
|
||||
gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
|
||||
Gtk::Menu *editor_ruler_menu;
|
||||
|
||||
|
||||
ArdourCanvas::SimpleRect* tempo_bar;
|
||||
ArdourCanvas::SimpleRect* meter_bar;
|
||||
ArdourCanvas::SimpleRect* marker_bar;
|
||||
ArdourCanvas::SimpleRect* range_marker_bar;
|
||||
ArdourCanvas::SimpleRect* transport_marker_bar;
|
||||
ArdourCanvas::SimpleRect* cd_marker_bar;
|
||||
|
||||
|
||||
Gtk::Label minsec_label;
|
||||
Gtk::Label bbt_label;
|
||||
Gtk::Label smpte_label;
|
||||
@@ -824,7 +824,7 @@ class Editor : public PublicEditor
|
||||
Gtk::HBox time_button_hbox;
|
||||
|
||||
friend class EditorCursor;
|
||||
|
||||
|
||||
EditorCursor* playhead_cursor;
|
||||
ArdourCanvas::Group* cursor_group;
|
||||
|
||||
@@ -861,7 +861,7 @@ class Editor : public PublicEditor
|
||||
|
||||
Gtk::HBox top_hbox;
|
||||
Gtk::HBox bottom_hbox;
|
||||
|
||||
|
||||
Gtk::Table edit_packer;
|
||||
Gtk::VScrollbar edit_vscrollbar;
|
||||
|
||||
@@ -877,7 +877,7 @@ class Editor : public PublicEditor
|
||||
bool _dragging_hscrollbar;
|
||||
|
||||
void reset_hscrollbar_stepping ();
|
||||
|
||||
|
||||
bool hscrollbar_button_press (GdkEventButton*);
|
||||
bool hscrollbar_button_release (GdkEventButton*);
|
||||
void hscrollbar_allocate (Gtk::Allocation &alloc);
|
||||
@@ -904,7 +904,7 @@ class Editor : public PublicEditor
|
||||
sigc::connection control_scroll_connection;
|
||||
|
||||
gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
|
||||
|
||||
|
||||
ArdourCanvas::Group* get_background_group () const { return _background_group; }
|
||||
ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
|
||||
double last_trackview_group_vertical_offset;
|
||||
@@ -913,19 +913,19 @@ class Editor : public PublicEditor
|
||||
void scroll_canvas_vertically ();
|
||||
|
||||
struct VisualChange {
|
||||
enum Type {
|
||||
enum Type {
|
||||
TimeOrigin = 0x1,
|
||||
ZoomLevel = 0x2,
|
||||
YOrigin = 0x4
|
||||
};
|
||||
|
||||
|
||||
Type pending;
|
||||
nframes64_t time_origin;
|
||||
double frames_per_unit;
|
||||
double y_origin;
|
||||
|
||||
|
||||
int idle_handler_id;
|
||||
|
||||
|
||||
VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
|
||||
void add (Type t) {
|
||||
pending = Type (pending | t);
|
||||
@@ -948,7 +948,7 @@ class Editor : public PublicEditor
|
||||
/* named selections */
|
||||
|
||||
struct NamedSelectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
NamedSelectionDisplayModelColumns() {
|
||||
NamedSelectionDisplayModelColumns() {
|
||||
add (text);
|
||||
add (selection);
|
||||
}
|
||||
@@ -1005,9 +1005,9 @@ class Editor : public PublicEditor
|
||||
nframes64_t last_update_frame;
|
||||
void center_screen (nframes64_t);
|
||||
void center_screen_internal (nframes64_t, float);
|
||||
|
||||
|
||||
void update_current_screen ();
|
||||
|
||||
|
||||
void session_going_away ();
|
||||
|
||||
nframes64_t cut_buffer_start;
|
||||
@@ -1021,7 +1021,7 @@ class Editor : public PublicEditor
|
||||
bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
|
||||
bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
|
||||
bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
|
||||
|
||||
|
||||
/* KEYMAP HANDLING */
|
||||
|
||||
void register_actions ();
|
||||
@@ -1039,7 +1039,7 @@ class Editor : public PublicEditor
|
||||
void paste_internal (nframes64_t position, float times);
|
||||
|
||||
/* EDITING OPERATIONS */
|
||||
|
||||
|
||||
void reset_point_selection ();
|
||||
void toggle_region_mute ();
|
||||
void toggle_region_lock ();
|
||||
@@ -1143,7 +1143,7 @@ class Editor : public PublicEditor
|
||||
void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
|
||||
|
||||
/* import & embed */
|
||||
|
||||
|
||||
void add_external_audio_action (Editing::ImportMode);
|
||||
void external_audio_dialog ();
|
||||
void session_import_dialog ();
|
||||
@@ -1152,15 +1152,15 @@ class Editor : public PublicEditor
|
||||
bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
|
||||
|
||||
SoundFileOmega* sfbrowser;
|
||||
|
||||
|
||||
void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
|
||||
|
||||
bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
|
||||
void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
|
||||
|
||||
|
||||
int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
|
||||
int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>, bool, uint32_t total);
|
||||
int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
|
||||
int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
|
||||
nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
|
||||
|
||||
int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
|
||||
@@ -1172,7 +1172,7 @@ class Editor : public PublicEditor
|
||||
boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
|
||||
|
||||
/* generic interthread progress window */
|
||||
|
||||
|
||||
ArdourDialog* interthread_progress_window;
|
||||
Gtk::Label interthread_progress_label;
|
||||
Gtk::VBox interthread_progress_vbox;
|
||||
@@ -1304,12 +1304,12 @@ class Editor : public PublicEditor
|
||||
|
||||
void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
|
||||
void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
|
||||
|
||||
|
||||
void set_fade_length (bool in);
|
||||
void toggle_fade_active (bool in);
|
||||
void set_fade_in_active (bool);
|
||||
void set_fade_out_active (bool);
|
||||
|
||||
|
||||
std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
|
||||
RegionSelection pre_drag_region_selection;
|
||||
|
||||
@@ -1352,7 +1352,7 @@ class Editor : public PublicEditor
|
||||
bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
|
||||
bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
|
||||
bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
|
||||
|
||||
|
||||
|
||||
// These variables are used to detect a feedback loop and break it to avoid a gui hang
|
||||
private:
|
||||
@@ -1416,15 +1416,15 @@ public:
|
||||
void initialize_canvas ();
|
||||
|
||||
/* display control */
|
||||
|
||||
|
||||
bool _show_measures;
|
||||
/// true if the editor should follow the playhead, otherwise false
|
||||
bool _follow_playhead;
|
||||
/// true if waveforms should be shown while recording audio tracks, otherwise false
|
||||
bool _show_waveforms_recording;
|
||||
|
||||
|
||||
ARDOUR::TempoMap::BBTPointList *current_bbt_points;
|
||||
|
||||
|
||||
TempoLines* tempo_lines;
|
||||
|
||||
ArdourCanvas::Group* time_line_group;
|
||||
@@ -1442,13 +1442,13 @@ public:
|
||||
void remove_meter_marker (ArdourCanvas::Item*);
|
||||
gint real_remove_tempo_marker (ARDOUR::TempoSection*);
|
||||
gint real_remove_meter_marker (ARDOUR::MeterSection*);
|
||||
|
||||
|
||||
void edit_tempo_section (ARDOUR::TempoSection*);
|
||||
void edit_meter_section (ARDOUR::MeterSection*);
|
||||
void edit_tempo_marker (ArdourCanvas::Item*);
|
||||
void edit_meter_marker (ArdourCanvas::Item*);
|
||||
void edit_control_point (ArdourCanvas::Item*);
|
||||
|
||||
|
||||
void marker_menu_edit ();
|
||||
void marker_menu_remove ();
|
||||
void marker_menu_rename ();
|
||||
@@ -1496,7 +1496,7 @@ public:
|
||||
void compute_current_bbt_points (nframes_t left, nframes_t right);
|
||||
void tempo_map_changed (ARDOUR::Change);
|
||||
void redisplay_tempo (bool immediate_redraw);
|
||||
|
||||
|
||||
void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
|
||||
void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
|
||||
void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false);
|
||||
@@ -1519,12 +1519,12 @@ public:
|
||||
|
||||
Gtk::Button tav_expand_button;
|
||||
Gtk::Button tav_shrink_button;
|
||||
|
||||
|
||||
Gtk::VBox toolbar_clock_vbox;
|
||||
Gtk::VBox toolbar_selection_clock_vbox;
|
||||
Gtk::VBox toolbar_selection_clock_vbox;
|
||||
Gtk::Table toolbar_selection_clock_table;
|
||||
Gtk::Label toolbar_selection_cursor_label;
|
||||
|
||||
|
||||
Gtk::HBox mouse_mode_button_box;
|
||||
Gtkmm2ext::TearOff* mouse_mode_tearoff;
|
||||
Gtk::ToggleButton mouse_select_button;
|
||||
@@ -1572,7 +1572,7 @@ public:
|
||||
Gtk::VBox zoom_focus_box;
|
||||
|
||||
std::vector<std::string> zoom_focus_strings;
|
||||
|
||||
|
||||
void zoom_focus_selection_done ();
|
||||
void zoom_focus_chosen (Editing::ZoomFocus);
|
||||
|
||||
@@ -1585,7 +1585,7 @@ public:
|
||||
void zoom_adjustment_changed();
|
||||
|
||||
void edit_point_clock_changed();
|
||||
|
||||
|
||||
void setup_toolbar ();
|
||||
|
||||
Gtkmm2ext::TearOff* tools_tearoff;
|
||||
@@ -1600,7 +1600,7 @@ public:
|
||||
Gtk::ToggleButton midi_sound_notes;
|
||||
void midi_panic ();
|
||||
bool sound_notes () const { return midi_sound_notes.get_active(); }
|
||||
|
||||
|
||||
void setup_midi_toolbar ();
|
||||
|
||||
/* selection process */
|
||||
@@ -1647,13 +1647,13 @@ public:
|
||||
ARDOUR::Location* transport_punch_location();
|
||||
|
||||
ARDOUR::Location *temp_location;
|
||||
|
||||
|
||||
/* object rubberband select process */
|
||||
|
||||
|
||||
bool select_all_within (nframes64_t start, nframes64_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
|
||||
|
||||
|
||||
ArdourCanvas::SimpleRect *rubberband_rect;
|
||||
|
||||
|
||||
/* mouse zoom process */
|
||||
|
||||
ArdourCanvas::SimpleRect *zoom_rect;
|
||||
@@ -1663,7 +1663,7 @@ public:
|
||||
EditorRoutes* _routes;
|
||||
EditorRegions* _regions;
|
||||
EditorSnapshots* _snapshots;
|
||||
|
||||
|
||||
/* diskstream/route display management */
|
||||
Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
|
||||
Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
|
||||
@@ -1778,7 +1778,7 @@ public:
|
||||
void begin_reversible_command (std::string cmd_name);
|
||||
void commit_reversible_command ();
|
||||
|
||||
void update_title ();
|
||||
void update_title ();
|
||||
void update_title_s (const std::string & snapshot_name);
|
||||
|
||||
struct State {
|
||||
@@ -1795,7 +1795,7 @@ public:
|
||||
void instant_save ();
|
||||
|
||||
boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
|
||||
|
||||
|
||||
/* freeze operations */
|
||||
|
||||
ARDOUR::InterThreadInfo freeze_status;
|
||||
@@ -1814,7 +1814,7 @@ public:
|
||||
/* duplication */
|
||||
|
||||
void duplicate_dialog (bool with_dialog);
|
||||
|
||||
|
||||
nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
|
||||
|
||||
/* returns false if mouse pointer is not in track or marker canvas
|
||||
@@ -1855,7 +1855,7 @@ public:
|
||||
/* xfades */
|
||||
|
||||
bool _xfade_visibility;
|
||||
|
||||
|
||||
#ifdef WITH_CMT
|
||||
void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
|
||||
void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
|
||||
@@ -1883,7 +1883,7 @@ public:
|
||||
void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
|
||||
void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
|
||||
void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
|
||||
|
||||
|
||||
void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
|
||||
void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
|
||||
void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
|
||||
@@ -1916,7 +1916,7 @@ public:
|
||||
|
||||
bool nudge_forward_release (GdkEventButton*);
|
||||
bool nudge_backward_release (GdkEventButton*);
|
||||
|
||||
|
||||
/* audio filters */
|
||||
|
||||
void apply_filter (ARDOUR::Filter&, std::string cmd);
|
||||
@@ -1989,7 +1989,7 @@ public:
|
||||
|
||||
void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
|
||||
void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
|
||||
|
||||
|
||||
void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
|
||||
|
||||
sigc::connection fast_screen_update_connection;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -50,7 +50,7 @@ Editor::register_actions ()
|
||||
RefPtr<Action> act;
|
||||
|
||||
editor_actions = ActionGroup::create (X_("Editor"));
|
||||
|
||||
|
||||
/* non-operative menu items for menu bar */
|
||||
|
||||
ActionManager::register_action (editor_actions, X_("AlignMenu"), _("Align"));
|
||||
@@ -199,12 +199,12 @@ Editor::register_actions ()
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "select-all-in-loop-range", _("Select All in Loop Range"), mem_fun(*this, &Editor::select_all_selectables_using_loop));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
|
||||
act = ActionManager::register_action (editor_actions, "select-next-route", _("Select Next Track/Bus"), mem_fun(*this, &Editor::select_next_route));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "select-prev-route", _("Select Previous Track/Bus"), mem_fun(*this, &Editor::select_prev_route));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
|
||||
act = ActionManager::register_action (editor_actions, "track-record-enable-toggle", _("Toggle Record Enable"), mem_fun(*this, &Editor::toggle_record_enable));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
@@ -404,7 +404,7 @@ Editor::register_actions ()
|
||||
act = ActionManager::register_action (editor_actions, "add-range-markers-from-region", _("Add Range Marker(s)"), mem_fun(*this, &Editor::add_locations_from_audio_region));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::region_selection_sensitive_actions.push_back (act);
|
||||
|
||||
|
||||
act = ActionManager::register_action (editor_actions, "set-fade-in-length", _("Set Fade In Length"), bind (mem_fun(*this, &Editor::set_fade_length), true));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "toggle-fade-in-active", _("Toggle Fade In Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), true));
|
||||
@@ -553,7 +553,7 @@ Editor::register_actions ()
|
||||
act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Region"), mem_fun(*this, &Editor::quantize_region));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::region_selection_sensitive_actions.push_back (act);
|
||||
|
||||
|
||||
act = ActionManager::register_action (editor_actions, "set-tempo-from-region", _("Set Tempo from Region=Bar"), mem_fun(*this, &Editor::use_region_as_bar));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::region_selection_sensitive_actions.push_back (act);
|
||||
@@ -705,9 +705,9 @@ Editor::register_actions ()
|
||||
mouse_timefx_button.set_image (*(manage (new Image (::get_icon("tool_stretch")))));
|
||||
mouse_timefx_button.set_label ("");
|
||||
mouse_timefx_button.set_name ("MouseModeButton");
|
||||
|
||||
|
||||
ActionManager::register_action (editor_actions, "step-mouse-mode", _("Step Mouse Mode"), bind (mem_fun(*this, &Editor::step_mouse_mode), true));
|
||||
|
||||
|
||||
act = ActionManager::register_toggle_action (mouse_mode_actions, "toggle-internal-edit", _("Edit MIDI"), mem_fun(*this, &Editor::toggle_internal_editing));
|
||||
act->connect_proxy (internal_edit_button);
|
||||
internal_edit_button.set_image (*(manage (new Image (::get_icon("tool_note")))));
|
||||
@@ -762,7 +762,7 @@ Editor::register_actions ()
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-boundary"), _("Snap to Region Boundary"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionBoundary)));
|
||||
|
||||
/* RULERS */
|
||||
|
||||
|
||||
Glib::RefPtr<ActionGroup> ruler_actions = ActionGroup::create (X_("Rulers"));
|
||||
ruler_tempo_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-tempo-ruler"), _("Tempo"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_tempo)));
|
||||
ruler_meter_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-meter-ruler"), _("Meter"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_meter)));
|
||||
@@ -797,7 +797,7 @@ Editor::register_actions ()
|
||||
}
|
||||
ruler_samples_action->set_active (false);
|
||||
no_ruler_shown_update = false;
|
||||
|
||||
|
||||
/* REGION LIST */
|
||||
|
||||
Glib::RefPtr<ActionGroup> rl_actions = ActionGroup::create (X_("RegionList"));
|
||||
@@ -820,7 +820,7 @@ Editor::register_actions ()
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), true));
|
||||
ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"), _("Descending"),
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), false));
|
||||
|
||||
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionName"), _("By Region Name"),
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByName, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionLength"), _("By Region Length"),
|
||||
@@ -841,7 +841,7 @@ Editor::register_actions ()
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileCreationDate, false));
|
||||
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"), _("By Source Filesystem"),
|
||||
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileFS, false));
|
||||
|
||||
|
||||
|
||||
/* the next two are duplicate items with different names for use in two different contexts */
|
||||
|
||||
@@ -861,9 +861,9 @@ Editor::register_actions ()
|
||||
ActionManager::register_toggle_action (editor_actions, X_("ToggleSummary"), _("Show Summary"), mem_fun (*this, &Editor::set_summary));
|
||||
|
||||
ActionManager::register_toggle_action (editor_actions, X_("ToggleGroupTabs"), _("Show Group Tabs"), mem_fun (*this, &Editor::set_group_tabs));
|
||||
|
||||
|
||||
ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
|
||||
|
||||
|
||||
/* if there is a logo in the editor canvas, its always visible at startup */
|
||||
|
||||
act = ActionManager::register_toggle_action (editor_actions, X_("ToggleLogoVisibility"), _("Show Logo"), mem_fun (*this, &Editor::toggle_logo_visibility));
|
||||
@@ -997,7 +997,7 @@ Editor::snap_type_action (SnapType type)
|
||||
|
||||
const char* action = 0;
|
||||
RefPtr<Action> act;
|
||||
|
||||
|
||||
switch (type) {
|
||||
case Editing::SnapToCDFrame:
|
||||
action = "snap-to-cd-frame";
|
||||
@@ -1151,7 +1151,7 @@ Editor::snap_mode_action (SnapMode mode)
|
||||
{
|
||||
const char* action = 0;
|
||||
RefPtr<Action> act;
|
||||
|
||||
|
||||
switch (mode) {
|
||||
case Editing::SnapOff:
|
||||
action = X_("snap-off");
|
||||
@@ -1166,13 +1166,13 @@ Editor::snap_mode_action (SnapMode mode)
|
||||
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap mode type", (int) mode) << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
|
||||
act = ActionManager::get_action (X_("Editor"), action);
|
||||
|
||||
|
||||
if (act) {
|
||||
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
||||
return ract;
|
||||
|
||||
|
||||
} else {
|
||||
error << string_compose (_("programming error: %1: %2"), "Editor::snap_mode_chosen could not find action to match mode.", action) << endmsg;
|
||||
return RefPtr<RadioAction> ();
|
||||
@@ -1215,7 +1215,7 @@ Editor::edit_point_action (EditPoint ep)
|
||||
{
|
||||
const char* action = 0;
|
||||
RefPtr<Action> act;
|
||||
|
||||
|
||||
switch (ep) {
|
||||
case Editing::EditAtPlayhead:
|
||||
action = X_("edit-at-playhead");
|
||||
@@ -1230,13 +1230,13 @@ Editor::edit_point_action (EditPoint ep)
|
||||
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible edit point type", (int) ep) << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
|
||||
act = ActionManager::get_action (X_("Editor"), action);
|
||||
|
||||
|
||||
if (act) {
|
||||
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
||||
return ract;
|
||||
|
||||
|
||||
} else {
|
||||
error << string_compose (_("programming error: %1: %2"), "Editor::edit_point_action could not find action to match edit point.", action) << endmsg;
|
||||
return RefPtr<RadioAction> ();
|
||||
@@ -1264,7 +1264,7 @@ Editor::zoom_focus_action (ZoomFocus focus)
|
||||
{
|
||||
const char* action = 0;
|
||||
RefPtr<Action> act;
|
||||
|
||||
|
||||
switch (focus) {
|
||||
case ZoomFocusLeft:
|
||||
action = X_("zoom-focus-left");
|
||||
@@ -1288,9 +1288,9 @@ Editor::zoom_focus_action (ZoomFocus focus)
|
||||
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible focus type", (int) focus) << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
|
||||
act = ActionManager::get_action (X_("Zoom"), action);
|
||||
|
||||
|
||||
if (act) {
|
||||
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
||||
return ract;
|
||||
@@ -1343,7 +1343,7 @@ Editor::parameter_changed (std::string p)
|
||||
} else if (p == "show-track-meters") {
|
||||
toggle_meter_updating();
|
||||
} else if (p == "show-summary") {
|
||||
|
||||
|
||||
bool const s = session->config.get_show_summary ();
|
||||
if (s) {
|
||||
_summary->show ();
|
||||
@@ -1390,7 +1390,7 @@ Editor::reset_canvas_action_sensitivity (bool onoff)
|
||||
onoff = true;
|
||||
}
|
||||
|
||||
for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
|
||||
for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
|
||||
x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) {
|
||||
(*x)->set_sensitive (onoff);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2006 Paul Davis
|
||||
Copyright (C) 2000-2006 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
|
||||
@@ -80,7 +80,7 @@ Editor::add_external_audio_action (ImportMode mode_hint)
|
||||
msg.run ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (sfbrowser == 0) {
|
||||
sfbrowser = new SoundFileOmega (*this, _("Add existing media"), session, 0, true, mode_hint);
|
||||
} else {
|
||||
@@ -101,12 +101,12 @@ Editor::external_audio_dialog ()
|
||||
msg.run ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
track_cnt = 0;
|
||||
|
||||
for (TrackSelection::iterator x = selection->tracks.begin(); x != selection->tracks.end(); ++x) {
|
||||
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*>(*x);
|
||||
|
||||
|
||||
if (!atv) {
|
||||
continue;
|
||||
} else if (atv->is_audio_track()) {
|
||||
@@ -247,7 +247,7 @@ Editor::check_whether_and_how_to_import(string path, bool all_or_nothing)
|
||||
dialog.add_button("Import", 1);
|
||||
dialog.add_button("Cancel", 2);
|
||||
}
|
||||
|
||||
|
||||
//dialog.add_button("Skip all", 4); // All or rest?
|
||||
|
||||
dialog.show();
|
||||
@@ -265,60 +265,60 @@ Editor::get_nth_selected_audio_track (int nth) const
|
||||
{
|
||||
AudioTimeAxisView* atv;
|
||||
TrackSelection::iterator x;
|
||||
|
||||
|
||||
for (x = selection->tracks.begin(); nth > 0 && x != selection->tracks.end(); ++x) {
|
||||
|
||||
atv = dynamic_cast<AudioTimeAxisView*>(*x);
|
||||
|
||||
|
||||
if (!atv) {
|
||||
continue;
|
||||
} else if (atv->is_audio_track()) {
|
||||
--nth;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (x == selection->tracks.end()) {
|
||||
atv = dynamic_cast<AudioTimeAxisView*>(selection->tracks.back());
|
||||
} else {
|
||||
atv = dynamic_cast<AudioTimeAxisView*>(*x);
|
||||
}
|
||||
|
||||
|
||||
if (!atv || !atv->is_audio_track()) {
|
||||
return boost::shared_ptr<AudioTrack>();
|
||||
}
|
||||
|
||||
|
||||
return atv->audio_track();
|
||||
}
|
||||
}
|
||||
|
||||
boost::shared_ptr<MidiTrack>
|
||||
Editor::get_nth_selected_midi_track (int nth) const
|
||||
{
|
||||
MidiTimeAxisView* mtv;
|
||||
TrackSelection::iterator x;
|
||||
|
||||
|
||||
for (x = selection->tracks.begin(); nth > 0 && x != selection->tracks.end(); ++x) {
|
||||
|
||||
mtv = dynamic_cast<MidiTimeAxisView*>(*x);
|
||||
|
||||
|
||||
if (!mtv) {
|
||||
continue;
|
||||
} else if (mtv->is_midi_track()) {
|
||||
--nth;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (x == selection->tracks.end()) {
|
||||
mtv = dynamic_cast<MidiTimeAxisView*>(selection->tracks.back());
|
||||
} else {
|
||||
mtv = dynamic_cast<MidiTimeAxisView*>(*x);
|
||||
}
|
||||
|
||||
|
||||
if (!mtv || !mtv->is_midi_track()) {
|
||||
return boost::shared_ptr<MidiTrack>();
|
||||
}
|
||||
|
||||
|
||||
return mtv->midi_track();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::do_import (vector<ustring> paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, nframes64_t& pos)
|
||||
@@ -360,23 +360,23 @@ Editor::do_import (vector<ustring> paths, ImportDisposition chns, ImportMode mod
|
||||
to_import.push_back (*a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ok = true;
|
||||
|
||||
switch (chns) {
|
||||
case Editing::ImportDistinctFiles:
|
||||
|
||||
|
||||
if (mode == Editing::ImportToTrack) {
|
||||
track = get_nth_selected_audio_track (nth++);
|
||||
}
|
||||
|
||||
|
||||
ok = (import_sndfiles (to_import, mode, quality, pos, 1, -1, track, false, to_import.size()) == 0);
|
||||
break;
|
||||
|
||||
|
||||
case Editing::ImportDistinctChannels:
|
||||
ok = (import_sndfiles (to_import, mode, quality, pos, -1, -1, track, false, to_import.size()) == 0);
|
||||
break;
|
||||
|
||||
|
||||
case Editing::ImportSerializeFiles:
|
||||
ok = (import_sndfiles (to_import, mode, quality, pos, 1, 1, track, false, to_import.size()) == 0);
|
||||
break;
|
||||
@@ -416,7 +416,7 @@ Editor::do_embed (vector<ustring> paths, ImportDisposition chns, ImportMode mode
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case Editing::ImportDistinctChannels:
|
||||
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) {
|
||||
|
||||
@@ -449,15 +449,15 @@ Editor::do_embed (vector<ustring> paths, ImportDisposition chns, ImportMode mode
|
||||
}
|
||||
|
||||
ok = true;
|
||||
|
||||
out:
|
||||
|
||||
out:
|
||||
if (ok) {
|
||||
session->save_state ("");
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality quality, nframes64_t& pos,
|
||||
Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality quality, nframes64_t& pos,
|
||||
int target_regions, int target_tracks, boost::shared_ptr<Track> track, bool replace, uint32_t total)
|
||||
{
|
||||
WindowTitle title = string_compose (_("importing %1"), paths.front());
|
||||
@@ -483,9 +483,9 @@ Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality qual
|
||||
import_status.target_regions = target_regions;
|
||||
import_status.track = track;
|
||||
import_status.replace = replace;
|
||||
interthread_progress_connection = Glib::signal_timeout().connect
|
||||
interthread_progress_connection = Glib::signal_timeout().connect
|
||||
(bind (mem_fun(*this, &Editor::import_progress_timeout), (gpointer) 0), 500);
|
||||
|
||||
|
||||
track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
|
||||
gdk_flush ();
|
||||
|
||||
@@ -496,7 +496,7 @@ Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality qual
|
||||
|
||||
pthread_create_and_store ("import", &import_status.thread, 0, _import_thread, this);
|
||||
pthread_detach (import_status.thread);
|
||||
|
||||
|
||||
while (!import_status.done && !import_status.cancel) {
|
||||
gtk_main_iteration ();
|
||||
}
|
||||
@@ -504,20 +504,20 @@ Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality qual
|
||||
interthread_progress_window->hide ();
|
||||
import_status.done = true;
|
||||
interthread_progress_connection.disconnect ();
|
||||
|
||||
|
||||
if (!import_status.cancel && !import_status.sources.empty()) {
|
||||
if (add_sources (import_status.paths,
|
||||
import_status.sources,
|
||||
import_status.pos,
|
||||
import_status.mode,
|
||||
import_status.target_regions,
|
||||
import_status.target_tracks,
|
||||
if (add_sources (import_status.paths,
|
||||
import_status.sources,
|
||||
import_status.pos,
|
||||
import_status.mode,
|
||||
import_status.target_regions,
|
||||
import_status.target_tracks,
|
||||
import_status.track, false) == 0) {
|
||||
session->save_state ("");
|
||||
}
|
||||
|
||||
|
||||
/* update position from results */
|
||||
|
||||
|
||||
pos = import_status.pos;
|
||||
}
|
||||
|
||||
@@ -546,12 +546,12 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
|
||||
ustring path = *p;
|
||||
|
||||
/* lets see if we can link it into the session */
|
||||
|
||||
|
||||
sys::path tmp = session->session_directory().sound_path() / Glib::path_get_basename(path);
|
||||
linked_path = tmp.to_string();
|
||||
|
||||
path_to_use = linked_path;
|
||||
|
||||
|
||||
if (link (path.c_str(), linked_path.c_str()) == 0) {
|
||||
|
||||
/* there are many reasons why link(2) might have failed.
|
||||
@@ -559,7 +559,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
|
||||
session sound dir that will protect against
|
||||
unlinking of the original path. nice.
|
||||
*/
|
||||
|
||||
|
||||
path = linked_path;
|
||||
path_to_use = Glib::path_get_basename (path);
|
||||
|
||||
@@ -578,31 +578,31 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* note that we temporarily truncated _id at the colon */
|
||||
|
||||
|
||||
string error_msg;
|
||||
|
||||
if (!AudioFileSource::get_soundfile_info (path, finfo, error_msg)) {
|
||||
error << string_compose(_("Editor: cannot open file \"%1\", (%2)"), path, error_msg ) << endmsg;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
if (check_sample_rate && (finfo.samplerate != (int) session->frame_rate())) {
|
||||
vector<string> choices;
|
||||
|
||||
|
||||
if (multifile) {
|
||||
choices.push_back (_("Cancel entire import"));
|
||||
choices.push_back (_("Don't embed it"));
|
||||
choices.push_back (_("Embed all without questions"));
|
||||
|
||||
|
||||
Gtkmm2ext::Choice rate_choice (
|
||||
string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"),
|
||||
string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"),
|
||||
short_path (path, 40)),
|
||||
choices, false);
|
||||
|
||||
|
||||
int resx = rate_choice.run ();
|
||||
|
||||
|
||||
switch (resx) {
|
||||
case 0: /* stop a multi-file import */
|
||||
ret = -2;
|
||||
@@ -622,13 +622,13 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
|
||||
} else {
|
||||
choices.push_back (_("Cancel"));
|
||||
choices.push_back (_("Embed it anyway"));
|
||||
|
||||
|
||||
Gtkmm2ext::Choice rate_choice (
|
||||
string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
|
||||
choices, false);
|
||||
|
||||
|
||||
int resx = rate_choice.run ();
|
||||
|
||||
|
||||
switch (resx) {
|
||||
case 0: /* don't import */
|
||||
ret = -1;
|
||||
@@ -641,7 +641,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
|
||||
|
||||
for (int n = 0; n < finfo.channels; ++n) {
|
||||
@@ -665,13 +665,13 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
|
||||
}
|
||||
|
||||
sources.push_back(source);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (failed_constructor& err) {
|
||||
error << string_compose(_("could not open %1"), path) << endmsg;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
ARDOUR_UI::instance()->flush_pending ();
|
||||
}
|
||||
}
|
||||
@@ -688,7 +688,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
|
||||
}
|
||||
|
||||
int
|
||||
Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64_t& pos, ImportMode mode,
|
||||
Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64_t& pos, ImportMode mode,
|
||||
int target_regions, int target_tracks, boost::shared_ptr<Track>& track, bool /*add_channel_suffix*/)
|
||||
{
|
||||
vector<boost::shared_ptr<Region> > regions;
|
||||
@@ -696,7 +696,7 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64
|
||||
uint32_t input_chan = 0;
|
||||
uint32_t output_chan = 0;
|
||||
bool use_timestamp;
|
||||
|
||||
|
||||
use_timestamp = (pos == -1);
|
||||
|
||||
if (use_timestamp) {
|
||||
@@ -716,17 +716,17 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64
|
||||
/* take all the sources we have and package them up as a region */
|
||||
|
||||
region_name = region_name_from_path (paths.front(), (sources.size() > 1), false);
|
||||
|
||||
|
||||
boost::shared_ptr<Region> r = RegionFactory::create (sources, 0, sources[0]->length(pos), region_name, 0,
|
||||
Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External));
|
||||
|
||||
if (use_timestamp && boost::dynamic_pointer_cast<AudioRegion>(r)) {
|
||||
boost::dynamic_pointer_cast<AudioRegion>(r)->special_set_position(sources[0]->natural_position());
|
||||
}
|
||||
|
||||
|
||||
regions.push_back (r);
|
||||
|
||||
|
||||
|
||||
} else if (target_regions == -1 || target_regions > 1) {
|
||||
|
||||
/* take each source and create a region for each one */
|
||||
@@ -739,16 +739,16 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64
|
||||
|
||||
just_one.clear ();
|
||||
just_one.push_back (*x);
|
||||
|
||||
|
||||
region_name = region_name_from_path ((*x)->path(), false, false, sources.size(), n);
|
||||
|
||||
boost::shared_ptr<Region> r = RegionFactory::create (just_one, 0, (*x)->length(pos), region_name, 0,
|
||||
Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External));
|
||||
|
||||
|
||||
if (use_timestamp && boost::dynamic_pointer_cast<AudioRegion>(r)) {
|
||||
boost::dynamic_pointer_cast<AudioRegion>(r)->special_set_position((*x)->natural_position());
|
||||
}
|
||||
|
||||
|
||||
regions.push_back (r);
|
||||
}
|
||||
}
|
||||
@@ -779,7 +779,7 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64
|
||||
track.reset ();
|
||||
} else {
|
||||
pos += (*r)->length();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* setup peak file building in another thread */
|
||||
@@ -790,9 +790,9 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, nframes64_t& pos,
|
||||
Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, nframes64_t& pos,
|
||||
ImportMode mode, boost::shared_ptr<Track>& existing_track)
|
||||
{
|
||||
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region);
|
||||
@@ -802,7 +802,7 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t
|
||||
case ImportAsRegion:
|
||||
/* relax, its been done */
|
||||
break;
|
||||
|
||||
|
||||
case ImportToTrack:
|
||||
{
|
||||
if (!existing_track) {
|
||||
@@ -829,7 +829,7 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t
|
||||
}
|
||||
|
||||
case ImportAsTrack:
|
||||
{
|
||||
{
|
||||
if (!existing_track) {
|
||||
if (ar) {
|
||||
list<boost::shared_ptr<AudioTrack> > at (session->new_audio_track (in_chans, out_chans, Normal, 0, 1));
|
||||
@@ -923,9 +923,9 @@ Editor::import_progress_timeout (void */*arg*/)
|
||||
if (reset) {
|
||||
|
||||
/* the window is now visible, speed up the updates */
|
||||
|
||||
|
||||
interthread_progress_connection.disconnect ();
|
||||
interthread_progress_connection = Glib::signal_timeout().connect
|
||||
interthread_progress_connection = Glib::signal_timeout().connect
|
||||
(bind (mem_fun(*this, &Editor::import_progress_timeout), (gpointer) 0), 100);
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
@@ -73,7 +73,7 @@ gint
|
||||
Editor::stop_updating ()
|
||||
{
|
||||
RouteTimeAxisView* rtv;
|
||||
|
||||
|
||||
meters_running = false;
|
||||
fast_screen_update_connection.disconnect();
|
||||
//cerr << "Editor::stop_updating () called" << endl;//DEBUG
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2005 Paul Davis
|
||||
Copyright (C) 2005 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
|
||||
@@ -69,22 +69,22 @@ GType gnome_canvas_imageframe_get_type(void);
|
||||
|
||||
}
|
||||
|
||||
static void ardour_canvas_type_init()
|
||||
static void ardour_canvas_type_init()
|
||||
{
|
||||
// Map gtypes to gtkmm wrapper-creation functions:
|
||||
|
||||
|
||||
Glib::wrap_register(gnome_canvas_simpleline_get_type(), &Gnome::Canvas::SimpleLine_Class::wrap_new);
|
||||
Glib::wrap_register(gnome_canvas_simplerect_get_type(), &Gnome::Canvas::SimpleRect_Class::wrap_new);
|
||||
Glib::wrap_register(gnome_canvas_waveview_get_type(), &Gnome::Canvas::WaveView_Class::wrap_new);
|
||||
// Glib::wrap_register(gnome_canvas_imageframe_get_type(), &Gnome::Canvas::ImageFrame_Class::wrap_new);
|
||||
|
||||
|
||||
// Register the gtkmm gtypes:
|
||||
|
||||
(void) Gnome::Canvas::WaveView::get_type();
|
||||
(void) Gnome::Canvas::SimpleLine::get_type();
|
||||
(void) Gnome::Canvas::SimpleRect::get_type();
|
||||
(void) Gnome::Canvas::ImageFrame::get_type();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::initialize_canvas ()
|
||||
@@ -94,7 +94,7 @@ Editor::initialize_canvas ()
|
||||
} else {
|
||||
track_canvas = new ArdourCanvas::CanvasAA ();
|
||||
}
|
||||
|
||||
|
||||
ArdourCanvas::init ();
|
||||
ardour_canvas_type_init ();
|
||||
|
||||
@@ -120,11 +120,11 @@ Editor::initialize_canvas ()
|
||||
verbose_canvas_cursor->property_anchor() = ANCHOR_NW;
|
||||
|
||||
delete font;
|
||||
|
||||
|
||||
verbose_cursor_visible = false;
|
||||
|
||||
/* on the bottom, an image */
|
||||
|
||||
|
||||
if (Profile->get_sae()) {
|
||||
Image img (::get_icon (X_("saelogo")));
|
||||
logo_item = new ArdourCanvas::Pixbuf (*track_canvas->root(), 0.0, 0.0, img.get_pixbuf());
|
||||
@@ -135,7 +135,7 @@ Editor::initialize_canvas ()
|
||||
logo_item->show ();
|
||||
}
|
||||
|
||||
/* a group to hold time (measure) lines */
|
||||
/* a group to hold time (measure) lines */
|
||||
time_line_group = new ArdourCanvas::Group (*track_canvas->root());
|
||||
|
||||
#ifdef GTKOSX
|
||||
@@ -186,7 +186,7 @@ Editor::initialize_canvas ()
|
||||
range_marker_bar->property_outline_pixels() = 0;
|
||||
}
|
||||
range_marker_bar->property_outline_what() = (0x1 | 0x8);
|
||||
|
||||
|
||||
transport_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root ());
|
||||
if (Profile->get_sae()) {
|
||||
transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height - 1));
|
||||
@@ -206,7 +206,7 @@ Editor::initialize_canvas ()
|
||||
marker_bar->property_outline_pixels() = 0;
|
||||
}
|
||||
marker_bar->property_outline_what() = (0x1 | 0x8);
|
||||
|
||||
|
||||
cd_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root ());
|
||||
if (Profile->get_sae()) {
|
||||
cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height - 1));
|
||||
@@ -245,27 +245,27 @@ Editor::initialize_canvas ()
|
||||
transport_punchin_line->property_x2() = 0.0;
|
||||
transport_punchin_line->property_y2() = physical_screen_height;
|
||||
transport_punchin_line->hide ();
|
||||
|
||||
|
||||
transport_punchout_line = new ArdourCanvas::SimpleLine (*_master_group);
|
||||
transport_punchout_line->property_x1() = 0.0;
|
||||
transport_punchout_line->property_y1() = 0.0;
|
||||
transport_punchout_line->property_x2() = 0.0;
|
||||
transport_punchout_line->property_y2() = physical_screen_height;
|
||||
transport_punchout_line->hide();
|
||||
|
||||
|
||||
// used to show zoom mode active zooming
|
||||
zoom_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
|
||||
zoom_rect->property_outline_pixels() = 1;
|
||||
zoom_rect->hide();
|
||||
|
||||
|
||||
zoom_rect->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_zoom_rect_event), (ArdourCanvas::Item*) 0));
|
||||
|
||||
|
||||
// used as rubberband rect
|
||||
rubberband_rect = new ArdourCanvas::SimpleRect (*_trackview_group, 0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
rubberband_rect->property_outline_pixels() = 1;
|
||||
rubberband_rect->hide();
|
||||
|
||||
|
||||
tempo_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_tempo_bar_event), tempo_bar));
|
||||
meter_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_meter_bar_event), meter_bar));
|
||||
marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_marker_bar_event), marker_bar));
|
||||
@@ -295,7 +295,7 @@ Editor::initialize_canvas ()
|
||||
/* set up drag-n-drop */
|
||||
|
||||
vector<TargetEntry> target_table;
|
||||
|
||||
|
||||
// Drag-N-Drop from the region list can generate this target
|
||||
target_table.push_back (TargetEntry ("regions"));
|
||||
|
||||
@@ -336,7 +336,7 @@ Editor::track_canvas_size_allocated ()
|
||||
height += (*i)->effective_height ();
|
||||
(*i)->clip_to_viewport ();
|
||||
}
|
||||
|
||||
|
||||
full_canvas_height = height + canvas_timebars_vsize;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ Editor::track_canvas_size_allocated ()
|
||||
if (playhead_cursor) {
|
||||
playhead_cursor->set_length (_canvas_height);
|
||||
}
|
||||
|
||||
|
||||
for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
|
||||
(*x)->set_line_vpos (0, _canvas_height);
|
||||
}
|
||||
@@ -352,7 +352,7 @@ Editor::track_canvas_size_allocated ()
|
||||
vertical_adjustment.set_page_size (_canvas_height);
|
||||
last_trackview_group_vertical_offset = get_trackview_group_vertical_offset ();
|
||||
if ((vertical_adjustment.get_value() + _canvas_height) >= vertical_adjustment.get_upper()) {
|
||||
/*
|
||||
/*
|
||||
We're increasing the size of the canvas while the bottom is visible.
|
||||
We scroll down to keep in step with the controls layout.
|
||||
*/
|
||||
@@ -381,14 +381,14 @@ Editor::controls_layout_size_request (Requisition* req)
|
||||
}
|
||||
|
||||
gint height = min ((gint) pos, (gint) (physical_screen_height - 600));
|
||||
|
||||
|
||||
bool changed = false;
|
||||
|
||||
gint w = edit_controls_vbox.get_width();
|
||||
if (_group_tabs->is_mapped()) {
|
||||
w += _group_tabs->get_width ();
|
||||
}
|
||||
|
||||
|
||||
gint width = max (w, controls_layout.get_width());
|
||||
|
||||
/* don't get too big. the fudge factors here are just guesses */
|
||||
@@ -407,7 +407,7 @@ Editor::controls_layout_size_request (Requisition* req)
|
||||
}
|
||||
req->width = width;
|
||||
|
||||
/* this one is important: it determines how big the layout thinks it really is, as
|
||||
/* this one is important: it determines how big the layout thinks it really is, as
|
||||
opposed to what it displays on the screen
|
||||
*/
|
||||
controls_layout.property_width () = vbox_width;
|
||||
@@ -426,7 +426,7 @@ Editor::controls_layout_size_request (Requisition* req)
|
||||
if (changed) {
|
||||
controls_layout_size_request_connection = controls_layout.signal_size_request().connect (mem_fun (*this, &Editor::controls_layout_size_request));
|
||||
}
|
||||
//cerr << "sizes = " << req->width << " " << edit_controls_vbox.get_width() << " " << controls_layout.get_width() << " " << zoom_box.get_width() << " " << time_button_frame.get_width() << endl;//DEBUG
|
||||
//cerr << "sizes = " << req->width << " " << edit_controls_vbox.get_width() << " " << controls_layout.get_width() << " " << zoom_box.get_width() << " " << time_button_frame.get_width() << endl;//DEBUG
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -438,9 +438,9 @@ Editor::track_canvas_map_handler (GdkEventAny* /*ev*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context,
|
||||
int x, int y,
|
||||
int x, int y,
|
||||
const SelectionData& data,
|
||||
guint info, guint time)
|
||||
{
|
||||
@@ -471,21 +471,21 @@ Editor::drop_paths_part_two (const vector<ustring>& paths, nframes64_t frame, do
|
||||
frame = 0;
|
||||
|
||||
if (Profile->get_sae() || Config->get_only_copy_imported_files()) {
|
||||
do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, SrcBest, frame);
|
||||
do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, SrcBest, frame);
|
||||
} else {
|
||||
do_embed (paths, Editing::ImportDistinctFiles, ImportAsTrack, frame);
|
||||
}
|
||||
|
||||
|
||||
} else if ((tv = dynamic_cast<RouteTimeAxisView*> (tvp.first)) != 0) {
|
||||
|
||||
/* check that its an audio track, not a bus */
|
||||
|
||||
|
||||
if (tv->get_diskstream()) {
|
||||
/* select the track, then embed/import */
|
||||
selection->set (tv);
|
||||
|
||||
if (Profile->get_sae() || Config->get_only_copy_imported_files()) {
|
||||
do_import (paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, SrcBest, frame);
|
||||
do_import (paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, SrcBest, frame);
|
||||
} else {
|
||||
do_embed (paths, Editing::ImportSerializeFiles, ImportToTrack, frame);
|
||||
}
|
||||
@@ -495,7 +495,7 @@ Editor::drop_paths_part_two (const vector<ustring>& paths, nframes64_t frame, do
|
||||
|
||||
void
|
||||
Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
|
||||
int x, int y,
|
||||
int x, int y,
|
||||
const SelectionData& data,
|
||||
guint info, guint time)
|
||||
{
|
||||
@@ -507,20 +507,20 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
|
||||
double cy;
|
||||
|
||||
if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
|
||||
|
||||
|
||||
/* D-n-D coordinates are window-relative, so convert to "world" coordinates
|
||||
*/
|
||||
|
||||
track_canvas->window_to_world (x, y, wx, wy);
|
||||
|
||||
|
||||
ev.type = GDK_BUTTON_RELEASE;
|
||||
ev.button.x = wx;
|
||||
ev.button.y = wy;
|
||||
|
||||
|
||||
frame = event_frame (&ev, 0, &cy);
|
||||
|
||||
|
||||
snap_to (frame);
|
||||
|
||||
|
||||
#ifdef GTKOSX
|
||||
/* We are not allowed to call recursive main event loops from within
|
||||
the main event loop with GTK/Quartz. Since import/embed wants
|
||||
@@ -537,7 +537,7 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
|
||||
|
||||
void
|
||||
Editor::drop_regions (const RefPtr<Gdk::DragContext>& /*context*/,
|
||||
int /*x*/, int /*y*/,
|
||||
int /*x*/, int /*y*/,
|
||||
const SelectionData& /*data*/,
|
||||
guint /*info*/, guint /*time*/)
|
||||
{
|
||||
@@ -586,7 +586,7 @@ Editor::maybe_autoscroll (GdkEventMotion* event, bool allow_vert)
|
||||
if ((autoscroll_x != last_autoscroll_x) || (autoscroll_y != last_autoscroll_y) || (autoscroll_x == 0 && autoscroll_y == 0)) {
|
||||
stop_canvas_autoscroll ();
|
||||
}
|
||||
|
||||
|
||||
if (startit && autoscroll_timeout_tag < 0) {
|
||||
start_canvas_autoscroll (autoscroll_x, autoscroll_y);
|
||||
}
|
||||
@@ -672,13 +672,13 @@ Editor::autoscroll_canvas ()
|
||||
new_pixel = min (top_of_bottom_of_canvas, new_pixel);
|
||||
|
||||
target_pixel = _drag->current_pointer_y() + autoscroll_y_distance;
|
||||
|
||||
|
||||
/* don't move to the full canvas height because the item will be invisible
|
||||
(its top edge will line up with the bottom of the visible canvas.
|
||||
*/
|
||||
|
||||
target_pixel = min (target_pixel, full_canvas_height - 10);
|
||||
|
||||
|
||||
} else {
|
||||
target_pixel = _drag->current_pointer_y();
|
||||
new_pixel = vertical_pos;
|
||||
@@ -717,7 +717,7 @@ Editor::autoscroll_canvas ()
|
||||
autoscroll_timeout_tag = g_idle_add ( _autoscroll_canvas, this);
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -737,7 +737,7 @@ Editor::start_canvas_autoscroll (int dx, int dy)
|
||||
autoscroll_x_distance = (nframes64_t) floor (current_page_frames()/50.0);
|
||||
autoscroll_y_distance = fabs (dy * 5); /* pixels */
|
||||
autoscroll_cnt = 0;
|
||||
|
||||
|
||||
/* do it right now, which will start the repeated callbacks */
|
||||
|
||||
autoscroll_canvas ();
|
||||
@@ -921,7 +921,7 @@ Editor::update_canvas_now ()
|
||||
and need_redraw to FALSE without checking to see if an idle handler is scheduled.
|
||||
If one is scheduled, GC should probably remove it.
|
||||
*/
|
||||
|
||||
|
||||
GnomeCanvas* c = track_canvas->gobj ();
|
||||
if (c->need_update || c->need_redraw) {
|
||||
track_canvas->update_now ();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000 Paul Davis
|
||||
Copyright (C) 2000 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
|
||||
@@ -65,7 +65,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
||||
double wx, wy;
|
||||
nframes64_t xdelta;
|
||||
int direction = ev->direction;
|
||||
|
||||
|
||||
Gnome::Canvas::Item* item = track_canvas->get_item_at(ev->x, ev->y);
|
||||
InteractiveItem* interactive_item = dynamic_cast<InteractiveItem*>(item);
|
||||
if (interactive_item) {
|
||||
@@ -77,9 +77,9 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
||||
case GDK_SCROLL_UP:
|
||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
||||
//if (ev->state == GDK_CONTROL_MASK) {
|
||||
/* XXX
|
||||
/* XXX
|
||||
the ev->x will be out of step with the canvas
|
||||
if we're in mid zoom, so we have to get the damn mouse
|
||||
if we're in mid zoom, so we have to get the damn mouse
|
||||
pointer again
|
||||
*/
|
||||
track_canvas->get_pointer (x, y);
|
||||
@@ -89,7 +89,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
||||
event.type = GDK_BUTTON_RELEASE;
|
||||
event.button.x = wx;
|
||||
event.button.y = wy;
|
||||
|
||||
|
||||
nframes64_t where = event_frame (&event, 0, 0);
|
||||
temporal_zoom_to_frame (false, where);
|
||||
return true;
|
||||
@@ -124,7 +124,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
||||
event.type = GDK_BUTTON_RELEASE;
|
||||
event.button.x = wx;
|
||||
event.button.y = wy;
|
||||
|
||||
|
||||
nframes64_t where = event_frame (&event, 0, 0);
|
||||
temporal_zoom_to_frame (true, where);
|
||||
return true;
|
||||
@@ -147,7 +147,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
||||
scroll_tracks_down_line ();
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case GDK_SCROLL_LEFT:
|
||||
xdelta = (current_page_frames() / 8);
|
||||
@@ -226,7 +226,7 @@ bool
|
||||
Editor::typed_event (ArdourCanvas::Item* item, GdkEvent *event, ItemType type)
|
||||
{
|
||||
gint ret = FALSE;
|
||||
|
||||
|
||||
switch (event->type) {
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_2BUTTON_PRESS:
|
||||
@@ -304,7 +304,7 @@ bool
|
||||
Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, RouteTimeAxisView *tv)
|
||||
{
|
||||
bool ret = FALSE;
|
||||
|
||||
|
||||
switch (event->type) {
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_2BUTTON_PRESS:
|
||||
@@ -406,11 +406,11 @@ Editor::canvas_fade_in_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRe
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* proxy for the regionview */
|
||||
|
||||
|
||||
return canvas_region_view_event (event, rv->get_canvas_group(), rv);
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ bool
|
||||
Editor::canvas_fade_in_handle_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRegionView *rv)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
|
||||
if (!rv->sensitive()) {
|
||||
return false;
|
||||
}
|
||||
@@ -485,11 +485,11 @@ Editor::canvas_fade_out_event (GdkEvent *event, ArdourCanvas::Item* item, AudioR
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* proxy for the regionview */
|
||||
|
||||
|
||||
return canvas_region_view_event (event, rv->get_canvas_group(), rv);
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ bool
|
||||
Editor::canvas_fade_out_handle_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRegionView *rv)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
|
||||
if (!rv->sensitive()) {
|
||||
return false;
|
||||
}
|
||||
@@ -553,7 +553,7 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
|
||||
clicked_axisview = &clicked_crossfadeview->get_time_axis_view();
|
||||
if (event->button.button == 3) {
|
||||
return button_press_handler (item, event, CrossfadeViewItem);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case GDK_BUTTON_RELEASE:
|
||||
@@ -565,7 +565,7 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* XXX do not forward double clicks */
|
||||
@@ -573,13 +573,13 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
|
||||
if (event->type == GDK_2BUTTON_PRESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* proxy for an underlying regionview */
|
||||
|
||||
/* XXX really need to check if we are in the name highlight,
|
||||
and proxy to that when required.
|
||||
*/
|
||||
|
||||
|
||||
TimeAxisView& tv (xfv->get_time_axis_view());
|
||||
AudioTimeAxisView* atv;
|
||||
|
||||
@@ -589,26 +589,26 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
|
||||
|
||||
boost::shared_ptr<AudioPlaylist> pl;
|
||||
if ((pl = boost::dynamic_pointer_cast<AudioPlaylist> (atv->get_diskstream()->playlist())) != 0) {
|
||||
|
||||
|
||||
Playlist::RegionList* rl = pl->regions_at (event_frame (event));
|
||||
if (!rl->empty()) {
|
||||
|
||||
|
||||
if (atv->layer_display() == Overlaid) {
|
||||
|
||||
|
||||
/* we're in overlaid mode; proxy to the uppermost region view */
|
||||
|
||||
|
||||
DescendingRegionLayerSorter cmp;
|
||||
rl->sort (cmp);
|
||||
|
||||
|
||||
RegionView* rv = atv->view()->find_view (rl->front());
|
||||
|
||||
|
||||
delete rl;
|
||||
|
||||
|
||||
/* proxy */
|
||||
return canvas_region_view_event (event, rv->get_canvas_group(), rv);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
/* we're in stacked mode; proxy to the region view under the mouse */
|
||||
|
||||
/* XXX: FIXME: this is an evil hack; it assumes that any event for which
|
||||
@@ -692,7 +692,7 @@ bool
|
||||
Editor::canvas_selection_rect_event (GdkEvent *event, ArdourCanvas::Item* item, SelectionRect* rect)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
|
||||
switch (event->type) {
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_2BUTTON_PRESS:
|
||||
@@ -718,7 +718,7 @@ Editor::canvas_selection_rect_event (GdkEvent *event, ArdourCanvas::Item* item,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -751,7 +751,7 @@ Editor::canvas_selection_start_trim_event (GdkEvent *event, ArdourCanvas::Item*
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -784,7 +784,7 @@ Editor::canvas_selection_end_trim_event (GdkEvent *event, ArdourCanvas::Item* it
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1012,7 +1012,7 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const & /*c*/,
|
||||
double px;
|
||||
double py;
|
||||
nframes64_t const pos = event_frame (&event, &px, &py);
|
||||
|
||||
|
||||
std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py);
|
||||
if (tv.first == 0) {
|
||||
return true;
|
||||
@@ -1027,20 +1027,20 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const & /*c*/,
|
||||
|
||||
boost::shared_ptr<Region> region_copy = RegionFactory::create (region);
|
||||
|
||||
if (boost::dynamic_pointer_cast<AudioRegion> (region_copy) != 0 &&
|
||||
if (boost::dynamic_pointer_cast<AudioRegion> (region_copy) != 0 &&
|
||||
dynamic_cast<AudioTimeAxisView*> (tv.first) == 0) {
|
||||
|
||||
/* audio -> non-audio */
|
||||
return true;
|
||||
}
|
||||
|
||||
if (boost::dynamic_pointer_cast<MidiRegion> (region_copy) == 0 &&
|
||||
if (boost::dynamic_pointer_cast<MidiRegion> (region_copy) == 0 &&
|
||||
dynamic_cast<MidiTimeAxisView*> (tv.first) != 0) {
|
||||
|
||||
/* MIDI -> non-MIDI */
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
_drag = new RegionInsertDrag (this, region_copy, rtav, pos);
|
||||
_drag->start_grab (&event);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009 Paul Davis
|
||||
Copyright (C) 2009 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
|
||||
@@ -30,7 +30,7 @@ EditorComponent::EditorComponent (Editor* e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
EditorComponent::connect_to_session (Session* s)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009 Paul Davis
|
||||
Copyright (C) 2009 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
|
||||
@@ -45,7 +45,7 @@ protected:
|
||||
private:
|
||||
|
||||
void session_going_away ();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000 Paul Davis
|
||||
Copyright (C) 2000 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
|
||||
@@ -60,7 +60,7 @@ void
|
||||
EditorCursor::set_position (nframes64_t frame)
|
||||
{
|
||||
PositionChanged (frame);
|
||||
|
||||
|
||||
double new_pos = editor.frame_to_unit (frame);
|
||||
|
||||
if (new_pos != points.front().get_x()) {
|
||||
@@ -76,12 +76,12 @@ EditorCursor::set_position (nframes64_t frame)
|
||||
void
|
||||
EditorCursor::set_length (double units)
|
||||
{
|
||||
length = units;
|
||||
length = units;
|
||||
points.back().set_y (points.front().get_y() + length);
|
||||
canvas_item.property_points() = points;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
EditorCursor::set_y_axis (double position)
|
||||
{
|
||||
points.front().set_y (position);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009 Paul Davis
|
||||
Copyright (C) 2009 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
|
||||
@@ -41,7 +41,7 @@ class TimeAxisView;
|
||||
/** Abstract base class for dragging of things within the editor */
|
||||
class Drag
|
||||
{
|
||||
|
||||
|
||||
public:
|
||||
Drag (Editor *, ArdourCanvas::Item *);
|
||||
virtual ~Drag () {}
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
|
||||
protected:
|
||||
nframes64_t adjusted_current_frame (GdkEvent *) const;
|
||||
|
||||
|
||||
Editor* _editor; ///< our editor
|
||||
ArdourCanvas::Item* _item; ///< our item
|
||||
nframes64_t _pointer_frame_offset; ///< offset from the mouse's position for the drag
|
||||
@@ -138,7 +138,7 @@ protected:
|
||||
bool _was_rolling; ///< true if the session was rolling before the drag started, otherwise false
|
||||
|
||||
private:
|
||||
|
||||
|
||||
bool _ending; ///< true if end_grab is in progress, otherwise false
|
||||
bool _had_movement; ///< true if movement has occurred, otherwise false
|
||||
bool _move_threshold_passed; ///< true if the move threshold has been passed, otherwise false
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
virtual ~RegionDrag () {}
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
RegionView* _primary; ///< the view that was clicked on (or whatever) to start the drag
|
||||
std::list<RegionView*> _views; ///< all views that are being dragged
|
||||
|
||||
@@ -166,7 +166,7 @@ private:
|
||||
class RegionMotionDrag : public RegionDrag
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
RegionMotionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool);
|
||||
virtual ~RegionMotionDrag () {}
|
||||
|
||||
@@ -177,13 +177,13 @@ public:
|
||||
protected:
|
||||
struct TimeAxisViewSummary {
|
||||
TimeAxisViewSummary () : height_list(512) {}
|
||||
|
||||
|
||||
std::bitset<512> tracks;
|
||||
std::vector<int32_t> height_list;
|
||||
int visible_y_low;
|
||||
int visible_y_high;
|
||||
};
|
||||
|
||||
|
||||
void copy_regions (GdkEvent *);
|
||||
bool y_movement_disallowed (int, int, int, TimeAxisViewSummary const &) const;
|
||||
std::map<RegionView*, std::pair<RouteTimeAxisView*, int> > find_time_axis_views_and_layers ();
|
||||
@@ -195,7 +195,7 @@ protected:
|
||||
|
||||
TimeAxisViewSummary get_time_axis_view_summary ();
|
||||
virtual bool x_move_allowed () const = 0;
|
||||
|
||||
|
||||
TimeAxisView* _dest_trackview;
|
||||
ARDOUR::layer_t _dest_layer;
|
||||
bool check_possible (RouteTimeAxisView **, ARDOUR::layer_t *);
|
||||
@@ -215,7 +215,7 @@ public:
|
||||
virtual void start_grab (GdkEvent *, Gdk::Cursor *);
|
||||
void motion (GdkEvent *, bool);
|
||||
void finished (GdkEvent *, bool);
|
||||
|
||||
|
||||
bool apply_move_threshold () const {
|
||||
return true;
|
||||
}
|
||||
@@ -233,7 +233,7 @@ public:
|
||||
RegionInsertDrag (Editor *, boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, nframes64_t);
|
||||
|
||||
void finished (GdkEvent *, bool);
|
||||
|
||||
|
||||
private:
|
||||
bool x_move_allowed () const;
|
||||
};
|
||||
@@ -281,7 +281,7 @@ private:
|
||||
|
||||
class NoteDrag : public Drag
|
||||
{
|
||||
public:
|
||||
public:
|
||||
NoteDrag (Editor*, ArdourCanvas::Item*);
|
||||
|
||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||
@@ -383,7 +383,7 @@ public:
|
||||
private:
|
||||
EditorCursor* _cursor; ///< cursor being dragged
|
||||
bool _stop; ///< true to stop the transport on starting the drag, otherwise false
|
||||
|
||||
|
||||
};
|
||||
|
||||
/** Region fade-in drag */
|
||||
@@ -421,7 +421,7 @@ public:
|
||||
|
||||
private:
|
||||
void update_item (ARDOUR::Location *);
|
||||
|
||||
|
||||
Marker* _marker; ///< marker being dragged
|
||||
std::list<ARDOUR::Location*> _copied_locations;
|
||||
ArdourCanvas::Line* _line;
|
||||
@@ -441,7 +441,7 @@ public:
|
||||
bool active (Editing::MouseMode m);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
ControlPoint* _point;
|
||||
double _cumulative_x_drag;
|
||||
double _cumulative_y_drag;
|
||||
@@ -457,7 +457,7 @@ public:
|
||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||
void motion (GdkEvent *, bool);
|
||||
void finished (GdkEvent *, bool);
|
||||
|
||||
|
||||
bool active (Editing::MouseMode) {
|
||||
return true;
|
||||
}
|
||||
@@ -497,7 +497,7 @@ class ScrubDrag : public Drag
|
||||
{
|
||||
public:
|
||||
ScrubDrag (Editor *e, ArdourCanvas::Item *i) : Drag (e, i) {}
|
||||
|
||||
|
||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||
void motion (GdkEvent *, bool);
|
||||
void finished (GdkEvent *, bool);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2007 Paul Davis
|
||||
Copyright (C) 2000-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2001 Paul Davis
|
||||
Copyright (C) 2001 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
|
||||
@@ -94,18 +94,18 @@ Editor::export_region ()
|
||||
if (selection->regions.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
boost::shared_ptr<Region> r = selection->regions.front()->region();
|
||||
AudioRegion & region (dynamic_cast<AudioRegion &> (*r));
|
||||
|
||||
|
||||
RouteTimeAxisView & rtv (dynamic_cast<RouteTimeAxisView &> (selection->regions.front()->get_time_axis_view()));
|
||||
AudioTrack & track (dynamic_cast<AudioTrack &> (*rtv.route()));
|
||||
|
||||
|
||||
ExportRegionDialog dialog (*this, region, track);
|
||||
dialog.set_session (session);
|
||||
dialog.run();
|
||||
|
||||
|
||||
} catch (std::bad_cast & e) {
|
||||
error << "Exporting Region failed!" << endmsg;
|
||||
return;
|
||||
@@ -130,7 +130,7 @@ void
|
||||
Editor::bounce_region_selection ()
|
||||
{
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
|
||||
|
||||
boost::shared_ptr<Region> region ((*i)->region());
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&(*i)->get_time_axis_view());
|
||||
Track* track = dynamic_cast<Track*>(rtv->route().get());
|
||||
@@ -167,7 +167,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
||||
const string sound_directory = session->session_directory().sound_path().to_string();
|
||||
|
||||
nchans = region->n_channels();
|
||||
|
||||
|
||||
/* don't do duplicate of the entire source if that's what is going on here */
|
||||
|
||||
if (region->start() == 0 && region->length() == region->source_length(0)) {
|
||||
@@ -178,7 +178,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
||||
if (path.length() == 0) {
|
||||
|
||||
for (uint32_t n=0; n < nchans; ++n) {
|
||||
|
||||
|
||||
for (cnt = 0; cnt < 999999; ++cnt) {
|
||||
if (nchans == 1) {
|
||||
snprintf (s, sizeof(s), "%s/%s_%" PRIu32 ".wav", sound_directory.c_str(),
|
||||
@@ -190,26 +190,26 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
||||
}
|
||||
|
||||
path = s;
|
||||
|
||||
|
||||
if (::access (path.c_str(), F_OK) != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (cnt == 999999) {
|
||||
error << "" << endmsg;
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
try {
|
||||
fs = boost::dynamic_pointer_cast<AudioFileSource> (
|
||||
SourceFactory::createWritable (DataType::AUDIO, *session,
|
||||
path, true,
|
||||
false, session->frame_rate()));
|
||||
}
|
||||
|
||||
|
||||
catch (failed_constructor& err) {
|
||||
goto error_out;
|
||||
}
|
||||
@@ -221,7 +221,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
||||
/* TODO: make filesources based on passed path */
|
||||
|
||||
}
|
||||
|
||||
|
||||
to_read = region->length();
|
||||
pos = region->position();
|
||||
|
||||
@@ -231,13 +231,13 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
||||
this_time = min (to_read, chunk_size);
|
||||
|
||||
for (vector<boost::shared_ptr<AudioFileSource> >::iterator src=sources.begin(); src != sources.end(); ++src) {
|
||||
|
||||
|
||||
fs = (*src);
|
||||
|
||||
if (region->read_at (buf, buf, gain_buffer, pos, this_time) != this_time) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (fs->write (buf, this_time) != this_time) {
|
||||
error << "" << endmsg;
|
||||
goto error_out;
|
||||
@@ -252,7 +252,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
||||
struct tm* now;
|
||||
time (&tnow);
|
||||
now = localtime (&tnow);
|
||||
|
||||
|
||||
for (vector<boost::shared_ptr<AudioFileSource> >::iterator src = sources.begin(); src != sources.end(); ++src) {
|
||||
(*src)->update_header (0, *now, tnow);
|
||||
(*src)->mark_immutable ();
|
||||
@@ -289,7 +289,7 @@ Editor::write_audio_selection (TimeSelection& ts)
|
||||
if (atv->is_audio_track()) {
|
||||
|
||||
boost::shared_ptr<AudioPlaylist> playlist = boost::dynamic_pointer_cast<AudioPlaylist>(atv->get_diskstream()->playlist());
|
||||
|
||||
|
||||
if (playlist && write_audio_range (*playlist, atv->get_diskstream()->n_channels(), ts) == 0) {
|
||||
ret = -1;
|
||||
break;
|
||||
@@ -319,7 +319,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
|
||||
uint32_t channels = count.n_audio();
|
||||
|
||||
for (uint32_t n=0; n < channels; ++n) {
|
||||
|
||||
|
||||
for (cnt = 0; cnt < 999999; ++cnt) {
|
||||
if (channels == 1) {
|
||||
snprintf (s, sizeof(s), "%s/%s_%" PRIu32 ".wav", sound_directory.c_str(),
|
||||
@@ -329,69 +329,69 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
|
||||
snprintf (s, sizeof(s), "%s/%s_%" PRIu32 "-%" PRId32 ".wav", sound_directory.c_str(),
|
||||
legalize_for_path(playlist.name()).c_str(), cnt, n);
|
||||
}
|
||||
|
||||
|
||||
if (::access (s, F_OK) != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (cnt == 999999) {
|
||||
error << "" << endmsg;
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
path = s;
|
||||
|
||||
|
||||
try {
|
||||
fs = boost::dynamic_pointer_cast<AudioFileSource> (
|
||||
SourceFactory::createWritable (DataType::AUDIO, *session,
|
||||
path, true,
|
||||
false, session->frame_rate()));
|
||||
}
|
||||
|
||||
|
||||
catch (failed_constructor& err) {
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
|
||||
sources.push_back (fs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (list<AudioRange>::iterator i = range.begin(); i != range.end();) {
|
||||
|
||||
|
||||
nframes = (*i).length();
|
||||
pos = (*i).start;
|
||||
|
||||
|
||||
while (nframes) {
|
||||
nframes64_t this_time;
|
||||
|
||||
|
||||
this_time = min (nframes, chunk_size);
|
||||
|
||||
for (uint32_t n=0; n < channels; ++n) {
|
||||
|
||||
fs = sources[n];
|
||||
|
||||
|
||||
if (playlist.read (buf, buf, gain_buffer, pos, this_time, n) != this_time) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (fs->write (buf, this_time) != this_time) {
|
||||
goto error_out;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nframes -= this_time;
|
||||
pos += this_time;
|
||||
}
|
||||
|
||||
|
||||
list<AudioRange>::iterator tmp = i;
|
||||
++tmp;
|
||||
|
||||
if (tmp != range.end()) {
|
||||
|
||||
|
||||
/* fill gaps with silence */
|
||||
|
||||
|
||||
nframes = (*tmp).start - (*i).end;
|
||||
|
||||
while (nframes) {
|
||||
@@ -424,7 +424,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
|
||||
(*s)->mark_immutable ();
|
||||
// do we need to ref it again?
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
error_out:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009 Paul Davis
|
||||
Copyright (C) 2009 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
|
||||
@@ -30,7 +30,7 @@ using namespace ARDOUR;
|
||||
EditorGroupTabs::EditorGroupTabs (Editor* e)
|
||||
: GroupTabs (e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
list<GroupTabs::Tab>
|
||||
@@ -48,7 +48,7 @@ EditorGroupTabs::compute_tabs () const
|
||||
if ((*i)->marked_for_display() == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
RouteGroup* g = (*i)->route_group ();
|
||||
|
||||
if (g != tab.group) {
|
||||
@@ -85,7 +85,7 @@ EditorGroupTabs::draw_tab (cairo_t* cr, Tab const & tab) const
|
||||
} else {
|
||||
cairo_set_source_rgba (cr, 1, 1, 1, 0.2);
|
||||
}
|
||||
|
||||
|
||||
cairo_move_to (cr, 0, tab.from + arc_radius);
|
||||
cairo_arc (cr, _width, tab.from + arc_radius, arc_radius, M_PI, 3 * M_PI / 2);
|
||||
cairo_line_to (cr, _width, tab.to);
|
||||
@@ -116,7 +116,7 @@ void
|
||||
EditorGroupTabs::reflect_tabs (list<Tab> const & tabs)
|
||||
{
|
||||
list<Tab>::const_iterator j = tabs.begin ();
|
||||
|
||||
|
||||
int32_t y = 0;
|
||||
for (Editor::TrackViewList::iterator i = _editor->track_views.begin(); i != _editor->track_views.end(); ++i) {
|
||||
|
||||
@@ -128,12 +128,12 @@ EditorGroupTabs::reflect_tabs (list<Tab> const & tabs)
|
||||
if (rtv) {
|
||||
|
||||
if (j == tabs.end()) {
|
||||
|
||||
|
||||
/* already run out of tabs, so no edit group */
|
||||
rtv->route()->set_route_group (0, this);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if (y >= j->to) {
|
||||
/* this tab finishes before this track starts, so onto the next tab */
|
||||
++j;
|
||||
@@ -146,7 +146,7 @@ EditorGroupTabs::reflect_tabs (list<Tab> const & tabs)
|
||||
} else {
|
||||
rtv->route()->set_route_group (0, this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009 Paul Davis
|
||||
Copyright (C) 2009 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2002 Paul Davis
|
||||
Copyright (C) 2002 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2000-2003 Paul Davis
|
||||
Copyright (C) 2000-2003 Paul Davis
|
||||
Written by Colin Law, CMT, Glasgow
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -50,7 +50,7 @@ TimeAxisView*
|
||||
Editor::get_named_time_axis(const string & name)
|
||||
{
|
||||
TimeAxisView* tav = 0 ;
|
||||
|
||||
|
||||
for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i)
|
||||
{
|
||||
if (((TimeAxisView*)*i)->name() == name)
|
||||
@@ -85,7 +85,7 @@ Editor::connect_to_image_compositor()
|
||||
{
|
||||
image_socket_listener = ImageFrameSocketHandler::create_instance(*this) ;
|
||||
}
|
||||
|
||||
|
||||
if(image_socket_listener->is_connected() == true)
|
||||
{
|
||||
return ;
|
||||
@@ -93,16 +93,16 @@ Editor::connect_to_image_compositor()
|
||||
|
||||
// XXX should really put this somewhere safe
|
||||
const char * host_ip = "127.0.0.1" ;
|
||||
|
||||
|
||||
bool retcode = image_socket_listener->connect(host_ip, ardourvis::DEFAULT_PORT) ;
|
||||
|
||||
|
||||
if(retcode == false)
|
||||
{
|
||||
// XXX need to get some return status here
|
||||
warning << "Image Compositor Connection attempt failed" << std::endl ;
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
// add the socket to the gui loop, and keep the retuned tag value of the input
|
||||
gint tag = gdk_input_add(image_socket_listener->get_socket_descriptor(), GDK_INPUT_READ,ImageFrameSocketHandler::image_socket_callback,image_socket_listener) ;
|
||||
image_socket_listener->set_gdk_input_tag(tag) ;
|
||||
@@ -122,7 +122,7 @@ Editor::scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item)
|
||||
} else {
|
||||
x_pos = item->get_position() - offset + (item->get_duration() / 2);
|
||||
}
|
||||
|
||||
|
||||
reset_x_origin (x_pos);
|
||||
}
|
||||
|
||||
@@ -139,11 +139,11 @@ void
|
||||
Editor::popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_item)
|
||||
{
|
||||
ImageFrameTimeAxis* ifta = dynamic_cast<ImageFrameTimeAxis*>(clicked_axisview) ;
|
||||
|
||||
|
||||
if(ifta)
|
||||
{
|
||||
ImageFrameTimeAxisGroup* iftag = ifta->get_view()->get_selected_imageframe_group() ;
|
||||
|
||||
|
||||
if(iftag)
|
||||
{
|
||||
ImageFrameView* selected_ifv = ifta->get_view()->get_selected_imageframe_view() ;
|
||||
@@ -156,7 +156,7 @@ void
|
||||
Editor::popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_item)
|
||||
{
|
||||
MarkerTimeAxis* mta = dynamic_cast<MarkerTimeAxis*>(clicked_axisview) ;
|
||||
|
||||
|
||||
if(mta)
|
||||
{
|
||||
MarkerView* selected_mv = mta->get_view()->get_selected_time_axis_item() ;
|
||||
@@ -179,7 +179,7 @@ Editor::canvas_imageframe_item_view_event (GdkEvent *event, ArdourCanvas::Item*
|
||||
{
|
||||
gint ret = FALSE ;
|
||||
ImageFrameTimeAxisGroup* iftag = 0 ;
|
||||
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case GDK_BUTTON_PRESS:
|
||||
@@ -207,7 +207,7 @@ Editor::canvas_imageframe_start_handle_event (GdkEvent *event, ArdourCanvas::Ite
|
||||
{
|
||||
gint ret = FALSE ;
|
||||
ImageFrameTimeAxisGroup* iftag = 0 ;
|
||||
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case GDK_BUTTON_PRESS:
|
||||
@@ -216,7 +216,7 @@ Editor::canvas_imageframe_start_handle_event (GdkEvent *event, ArdourCanvas::Ite
|
||||
clicked_axisview = &ifv->get_time_axis_view() ;
|
||||
iftag = ifv->get_time_axis_group() ;
|
||||
dynamic_cast<ImageFrameTimeAxis*>(clicked_axisview)->get_view()->set_selected_imageframe_view(iftag, ifv);
|
||||
|
||||
|
||||
ret = button_press_handler (item, event, ImageFrameHandleStartItem) ;
|
||||
break ;
|
||||
case GDK_BUTTON_RELEASE:
|
||||
@@ -242,7 +242,7 @@ Editor::canvas_imageframe_end_handle_event (GdkEvent *event, ArdourCanvas::Item*
|
||||
{
|
||||
gint ret = FALSE ;
|
||||
ImageFrameTimeAxisGroup* iftag = 0 ;
|
||||
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case GDK_BUTTON_PRESS:
|
||||
@@ -251,7 +251,7 @@ Editor::canvas_imageframe_end_handle_event (GdkEvent *event, ArdourCanvas::Item*
|
||||
clicked_axisview = &ifv->get_time_axis_view() ;
|
||||
iftag = ifv->get_time_axis_group() ;
|
||||
dynamic_cast<ImageFrameTimeAxis*>(clicked_axisview)->get_view()->set_selected_imageframe_view(iftag, ifv);
|
||||
|
||||
|
||||
ret = button_press_handler (item, event, ImageFrameHandleEndItem) ;
|
||||
break ;
|
||||
case GDK_BUTTON_RELEASE:
|
||||
@@ -429,10 +429,10 @@ Editor::start_imageframe_grab(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
drag_info.motion_callback = &Editor::imageframe_drag_motion_callback;
|
||||
drag_info.finished_callback = &Editor::timeaxis_item_drag_finished_callback;
|
||||
drag_info.last_frame_position = ifv->get_position() ;
|
||||
|
||||
|
||||
drag_info.source_trackview = &ifv->get_time_axis_view() ;
|
||||
drag_info.dest_trackview = drag_info.source_trackview;
|
||||
|
||||
|
||||
/* this is subtle. raising the regionview itself won't help,
|
||||
because raise_to_top() just puts the item on the top of
|
||||
its parent's stack. so, we need to put the trackview canvas_display group
|
||||
@@ -482,7 +482,7 @@ Editor::start_markerview_grab(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
cursor_group->raise_to_top ();
|
||||
|
||||
start_grab(event) ;
|
||||
|
||||
|
||||
drag_info.pointer_frame_offset = pixel_to_frame(drag_info.grab_x) - drag_info.last_frame_position ;
|
||||
}
|
||||
|
||||
@@ -504,14 +504,14 @@ Editor::markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent* event)
|
||||
{
|
||||
pending_region_position = pointer_frame - drag_info.pointer_frame_offset ;
|
||||
snap_to(pending_region_position) ;
|
||||
|
||||
|
||||
// we dont allow marker items to extend beyond, or in front of the marked items so
|
||||
// cap the value to the marked items position and duration
|
||||
if((pending_region_position + mv->get_duration()) >= ((mv->get_marked_item()->get_position()) + (mv->get_marked_item()->get_duration())))
|
||||
if((pending_region_position + mv->get_duration()) >= ((mv->get_marked_item()->get_position()) + (mv->get_marked_item()->get_duration())))
|
||||
{
|
||||
pending_region_position = (mv->get_marked_item()->get_position() + mv->get_marked_item()->get_duration()) - (mv->get_duration()) ;
|
||||
}
|
||||
else if(pending_region_position <= mv->get_marked_item()->get_position())
|
||||
else if(pending_region_position <= mv->get_marked_item()->get_position())
|
||||
{
|
||||
pending_region_position = mv->get_marked_item()->get_position() ;
|
||||
}
|
||||
@@ -522,7 +522,7 @@ Editor::markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent* event)
|
||||
}
|
||||
|
||||
drag_info.last_frame_position = pending_region_position ;
|
||||
|
||||
|
||||
// we treat this as a special case, usually we want to send the identitiy of the caller
|
||||
// but in this case, that would trigger our socket handler to handle the event, sending
|
||||
// notification to the image compositor. This would be fine, except that we have not
|
||||
@@ -538,9 +538,9 @@ void
|
||||
Editor::imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent* event)
|
||||
{
|
||||
double cx, cy ;
|
||||
|
||||
|
||||
ImageFrameView* ifv = reinterpret_cast<ImageFrameView*>(drag_info.data) ;
|
||||
|
||||
|
||||
nframes64_t pending_region_position;
|
||||
nframes64_t pointer_frame;
|
||||
|
||||
@@ -561,7 +561,7 @@ Editor::imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent* event)
|
||||
drag_info.grab_x = cx;
|
||||
//drag_info.last_frame_position = pending_region_position ;
|
||||
drag_info.current_pointer_frame = pending_region_position ;
|
||||
|
||||
|
||||
// we treat this as a special case, usually we want to send the identitiy of the caller
|
||||
// but in this case, that would trigger our socket handler to handle the event, sending
|
||||
// notification to the image compositor. This would be fine, except that we have not
|
||||
@@ -569,7 +569,7 @@ Editor::imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent* event)
|
||||
// completed the drag, only then do we want the image compositor notofied.
|
||||
// We therefore set the caller identity to the special case of 0
|
||||
ifv->set_position(pending_region_position, 0) ;
|
||||
|
||||
|
||||
show_verbose_time_cursor(pending_region_position) ;
|
||||
}
|
||||
|
||||
@@ -598,7 +598,7 @@ Editor::timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent* even
|
||||
{
|
||||
/* base the new region position on the current position of the regionview.*/
|
||||
where = drag_info.current_pointer_frame ;
|
||||
|
||||
|
||||
// final call to set position after the motion to tell interested parties of the new position
|
||||
tavi->set_position(where, this) ;
|
||||
}
|
||||
@@ -606,7 +606,7 @@ Editor::timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent* even
|
||||
{
|
||||
//where = tavi->get_position() ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -632,9 +632,9 @@ Editor::imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
drag_info.cumulative_x_drag = 0;
|
||||
drag_info.motion_callback = &Editor::imageframe_start_handle_trim_motion ;
|
||||
drag_info.finished_callback = &Editor::imageframe_start_handle_end_trim ;
|
||||
|
||||
|
||||
start_grab(event) ;
|
||||
|
||||
|
||||
show_verbose_time_cursor(ifv->get_position(), 10) ;
|
||||
}
|
||||
}
|
||||
@@ -648,14 +648,14 @@ Editor::imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
if(ifta)
|
||||
{
|
||||
ImageFrameView* ifv = ifta->get_view()->get_selected_imageframe_view() ;
|
||||
|
||||
|
||||
if (ifv == 0)
|
||||
{
|
||||
fatal << _("programming error: no ImageFrameView selected") << endmsg ;
|
||||
/*NOTREACHED*/
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
drag_info.item = ifv->get_canvas_frame() ;
|
||||
drag_info.data = ifv ;
|
||||
drag_info.grab_x = event->motion.x ;
|
||||
@@ -673,11 +673,11 @@ void
|
||||
Editor::imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
{
|
||||
ImageFrameView* ifv = reinterpret_cast<ImageFrameView*> (drag_info.data) ;
|
||||
|
||||
|
||||
nframes64_t start = 0 ;
|
||||
nframes64_t end = 0 ;
|
||||
nframes64_t pointer_frame = event_frame(event) ;
|
||||
|
||||
|
||||
// chekc th eposition of the item is not locked
|
||||
if(!ifv->get_position_locked()) {
|
||||
snap_to(pointer_frame) ;
|
||||
@@ -685,18 +685,18 @@ Editor::imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent*
|
||||
if(pointer_frame != drag_info.last_pointer_frame) {
|
||||
start = ifv->get_position() ;
|
||||
end = ifv->get_position() + ifv->get_duration() ;
|
||||
|
||||
|
||||
if (pointer_frame > end) {
|
||||
start = end ;
|
||||
} else {
|
||||
start = pointer_frame ;
|
||||
}
|
||||
|
||||
|
||||
// are we getting bigger or smaller?
|
||||
nframes64_t new_dur_val = end - start ;
|
||||
|
||||
|
||||
// start handle, so a smaller pointer frame increases our component size
|
||||
if(pointer_frame <= drag_info.grab_frame)
|
||||
if(pointer_frame <= drag_info.grab_frame)
|
||||
{
|
||||
if(ifv->get_max_duration_active() && (new_dur_val > ifv->get_max_duration()))
|
||||
{
|
||||
@@ -720,9 +720,9 @@ Editor::imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent*
|
||||
// current values are ok
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
drag_info.last_pointer_frame = pointer_frame ;
|
||||
|
||||
|
||||
/* re-calculatethe duration and position of the imageframeview */
|
||||
drag_info.cumulative_x_drag = new_dur_val ;
|
||||
|
||||
@@ -736,7 +736,7 @@ Editor::imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent*
|
||||
ifv->set_position(start, 0) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
show_verbose_time_cursor(start, 10) ;
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ void
|
||||
Editor::imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
{
|
||||
ImageFrameView* ifv = reinterpret_cast<ImageFrameView *> (drag_info.data) ;
|
||||
|
||||
|
||||
if (drag_info.cumulative_x_drag == 0)
|
||||
{
|
||||
/* just a click */
|
||||
@@ -752,7 +752,7 @@ Editor::imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* eve
|
||||
else
|
||||
{
|
||||
nframes64_t temp = ifv->get_position() + ifv->get_duration() ;
|
||||
|
||||
|
||||
ifv->set_position((nframes64_t) (temp - drag_info.cumulative_x_drag), this) ;
|
||||
ifv->set_duration((nframes64_t) drag_info.cumulative_x_drag, this) ;
|
||||
}
|
||||
@@ -762,14 +762,14 @@ void
|
||||
Editor::imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
{
|
||||
ImageFrameView* ifv = reinterpret_cast<ImageFrameView *> (drag_info.data) ;
|
||||
|
||||
|
||||
nframes64_t start = 0 ;
|
||||
nframes64_t end = 0 ;
|
||||
nframes64_t pointer_frame = event_frame(event) ;
|
||||
nframes64_t new_dur_val = 0 ;
|
||||
|
||||
snap_to(pointer_frame) ;
|
||||
|
||||
|
||||
if (pointer_frame != drag_info.last_pointer_frame)
|
||||
{
|
||||
start = ifv->get_position() ;
|
||||
@@ -782,9 +782,9 @@ Editor::imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev
|
||||
{
|
||||
end = pointer_frame ;
|
||||
}
|
||||
|
||||
|
||||
new_dur_val = end - start ;
|
||||
|
||||
|
||||
// are we getting bigger or smaller?
|
||||
if(pointer_frame >= drag_info.last_pointer_frame)
|
||||
{
|
||||
@@ -800,10 +800,10 @@ Editor::imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev
|
||||
new_dur_val = ifv->get_min_duration() ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
drag_info.last_pointer_frame = pointer_frame ;
|
||||
drag_info.cumulative_x_drag = new_dur_val ;
|
||||
|
||||
|
||||
// we treat this as a special case, usually we want to send the identitiy of the caller
|
||||
// but in this case, that would trigger our socket handler to handle the event, sending
|
||||
// notification to the image compositor. This would be fine, except that we have not
|
||||
@@ -812,7 +812,7 @@ Editor::imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev
|
||||
// We therefore set the caller identity to the special case of 0
|
||||
ifv->set_duration(new_dur_val, 0) ;
|
||||
}
|
||||
|
||||
|
||||
show_verbose_time_cursor(new_dur_val, 10) ;
|
||||
}
|
||||
|
||||
@@ -870,15 +870,15 @@ Editor::markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
/*NOTREACHED*/
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
drag_info.item = mv->get_canvas_frame() ;
|
||||
drag_info.data = mv ;
|
||||
drag_info.grab_x = event->motion.x ;
|
||||
drag_info.cumulative_x_drag = 0 ;
|
||||
|
||||
|
||||
drag_info.motion_callback = &Editor::markerview_end_handle_trim_motion ;
|
||||
drag_info.finished_callback = &Editor::markerview_end_handle_end_trim ;
|
||||
|
||||
|
||||
start_grab(event, trimmer_cursor) ;
|
||||
}
|
||||
|
||||
@@ -887,11 +887,11 @@ void
|
||||
Editor::markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
{
|
||||
MarkerView* mv = reinterpret_cast<MarkerView*> (drag_info.data) ;
|
||||
|
||||
|
||||
nframes64_t start = 0 ;
|
||||
nframes64_t end = 0 ;
|
||||
nframes64_t pointer_frame = event_frame(event) ;
|
||||
|
||||
|
||||
// chekc th eposition of the item is not locked
|
||||
if(!mv->get_position_locked())
|
||||
{
|
||||
@@ -900,7 +900,7 @@ Editor::markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent*
|
||||
{
|
||||
start = mv->get_position() ;
|
||||
end = mv->get_position() + mv->get_duration() ;
|
||||
|
||||
|
||||
if (pointer_frame > end)
|
||||
{
|
||||
start = end ;
|
||||
@@ -909,10 +909,10 @@ Editor::markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent*
|
||||
{
|
||||
start = pointer_frame ;
|
||||
}
|
||||
|
||||
|
||||
// are we getting bigger or smaller?
|
||||
nframes64_t new_dur_val = end - start ;
|
||||
|
||||
|
||||
if(pointer_frame <= drag_info.grab_frame)
|
||||
{
|
||||
if(mv->get_max_duration_active() && (new_dur_val > mv->get_max_duration()))
|
||||
@@ -937,12 +937,12 @@ Editor::markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent*
|
||||
// current values are ok
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
drag_info.last_pointer_frame = pointer_frame ;
|
||||
|
||||
|
||||
/* re-calculatethe duration and position of the imageframeview */
|
||||
drag_info.cumulative_x_drag = new_dur_val ;
|
||||
|
||||
|
||||
// we treat this as a special case, usually we want to send the identitiy of the caller
|
||||
// but in this case, that would trigger our socket handler to handle the event, sending
|
||||
// notification to the image compositor. This would be fine, except that we have not
|
||||
@@ -953,7 +953,7 @@ Editor::markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent*
|
||||
mv->set_position(start, 0) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
show_verbose_time_cursor(start, 10) ;
|
||||
}
|
||||
|
||||
@@ -961,7 +961,7 @@ void
|
||||
Editor::markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
{
|
||||
MarkerView* mv = reinterpret_cast<MarkerView*> (drag_info.data) ;
|
||||
|
||||
|
||||
if (drag_info.cumulative_x_drag == 0)
|
||||
{
|
||||
/* just a click */
|
||||
@@ -969,7 +969,7 @@ Editor::markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* eve
|
||||
else
|
||||
{
|
||||
nframes64_t temp = mv->get_position() + mv->get_duration() ;
|
||||
|
||||
|
||||
mv->set_position((nframes64_t) (temp - drag_info.cumulative_x_drag), this) ;
|
||||
mv->set_duration((nframes64_t) drag_info.cumulative_x_drag, this) ;
|
||||
}
|
||||
@@ -979,19 +979,19 @@ void
|
||||
Editor::markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event)
|
||||
{
|
||||
MarkerView* mv = reinterpret_cast<MarkerView*> (drag_info.data) ;
|
||||
|
||||
|
||||
nframes64_t start = 0 ;
|
||||
nframes64_t end = 0 ;
|
||||
nframes64_t pointer_frame = event_frame(event) ;
|
||||
nframes64_t new_dur_val = 0 ;
|
||||
|
||||
snap_to(pointer_frame) ;
|
||||
|
||||
|
||||
if (pointer_frame != drag_info.last_pointer_frame)
|
||||
{
|
||||
start = mv->get_position() ;
|
||||
end = mv->get_position() + mv->get_duration() ;
|
||||
|
||||
|
||||
if(pointer_frame < start)
|
||||
{
|
||||
end = start ;
|
||||
@@ -1000,16 +1000,16 @@ Editor::markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev
|
||||
{
|
||||
end = pointer_frame ;
|
||||
}
|
||||
|
||||
|
||||
new_dur_val = end - start ;
|
||||
|
||||
|
||||
// are we getting bigger or smaller?
|
||||
if(pointer_frame >= drag_info.last_pointer_frame)
|
||||
{
|
||||
// we cant extend beyond the item we are marking
|
||||
ImageFrameView* marked_item = mv->get_marked_item() ;
|
||||
nframes64_t marked_end = marked_item->get_position() + marked_item->get_duration() ;
|
||||
|
||||
|
||||
if(mv->get_max_duration_active() && (new_dur_val > mv->get_max_duration()))
|
||||
{
|
||||
if((start + mv->get_max_duration()) > marked_end)
|
||||
@@ -1037,7 +1037,7 @@ Editor::markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev
|
||||
|
||||
drag_info.last_pointer_frame = pointer_frame ;
|
||||
drag_info.cumulative_x_drag = new_dur_val ;
|
||||
|
||||
|
||||
// we treat this as a special case, usually we want to send the identitiy of the caller
|
||||
// but in this case, that would trigger our socket handler to handle the event, sending
|
||||
// notification to the image compositor. This would be fine, except that we have not
|
||||
@@ -1046,7 +1046,7 @@ Editor::markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev
|
||||
// We therefore set the caller identity to the special case of 0
|
||||
mv->set_duration(new_dur_val, 0) ;
|
||||
}
|
||||
|
||||
|
||||
show_verbose_time_cursor(new_dur_val, 10) ;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user