mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 14:16:31 +01:00
2 patches from jdavisp3; remove some debugging output from generic MIDI; rationalize string usage in SoundFileOmega; allow "mode hint" when using SoundFileOmega; restore context menu import functionality; bump to v2.1
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2490 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e79a7e8ff9
commit
dfa476334a
11 changed files with 79 additions and 74 deletions
|
|
@ -16,7 +16,7 @@ import SCons.Node.FS
|
|||
SConsignFile()
|
||||
EnsureSConsVersion(0, 96)
|
||||
|
||||
ardour_version = '2.0.5'
|
||||
ardour_version = '2.1'
|
||||
|
||||
subst_dict = { }
|
||||
|
||||
|
|
|
|||
|
|
@ -1174,6 +1174,7 @@ ARDOUR_UI::open_session ()
|
|||
open_session_selector = new Gtk::FileChooserDialog (_("open session"), FILE_CHOOSER_ACTION_OPEN);
|
||||
open_session_selector->add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
|
||||
open_session_selector->add_button (Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT);
|
||||
open_session_selector->set_default_response(Gtk::RESPONSE_ACCEPT);
|
||||
|
||||
FileFilter session_filter;
|
||||
session_filter.add_pattern ("*.ardour");
|
||||
|
|
|
|||
|
|
@ -151,36 +151,6 @@ const char *displaycontrolstrs[] = {
|
|||
#undef DISPLAYCONTROL
|
||||
#define DISPLAYCONTROL(a) /*empty*/
|
||||
|
||||
//IMPORTMODE
|
||||
#undef IMPORTMODE
|
||||
#define IMPORTMODE(s) N_(#s),
|
||||
const char *importmodestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef IMPORTMODE
|
||||
#define IMPORTMODE(a) /*empty*/
|
||||
|
||||
//IMPORTPOSITION
|
||||
#undef IMPORTPOSITION
|
||||
#define IMPORTPOSITION(s) N_(#s),
|
||||
const char *importpositionstrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef IMPORTPOSITION
|
||||
#define IMPORTPOSITION(a) /*empty*/
|
||||
|
||||
//IMPORTCHANNEL
|
||||
#undef IMPORTCHANNEL
|
||||
#define IMPORTCHANNEL(s) N_(#s),
|
||||
const char *importchannelstrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef IMPORTCHANNEL
|
||||
#define IMPORTCHANNEL(a) /*empty*/
|
||||
|
||||
|
||||
} // namespace Editing
|
||||
|
||||
|
|
|
|||
|
|
@ -139,10 +139,6 @@ enum ImportPosition {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
extern const char *importpositionstrs[];
|
||||
inline const char* enum2str(ImportPosition m) {return importpositionstrs[m];}
|
||||
ImportPosition str2importposition (const std::string &);
|
||||
|
||||
#undef IMPORTPOSITION
|
||||
#define IMPORTPOSITION(a) /*empty*/
|
||||
|
||||
|
|
@ -153,10 +149,6 @@ enum ImportDisposition {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
extern const char *importdispositionstrs[];
|
||||
inline const char* enum2str(ImportDisposition m) {return importdispositionstrs[m];}
|
||||
ImportDisposition str2importdisposition (const std::string &);
|
||||
|
||||
#undef IMPORTDISPOSITION
|
||||
#define IMPORTDISPOSITION(a) /*empty*/
|
||||
|
||||
|
|
|
|||
|
|
@ -379,17 +379,8 @@ Editor::register_actions ()
|
|||
|
||||
ActionManager::register_action (editor_actions, X_("addExistingAudioFiles"), _("Add Existing Audio"), mem_fun (*this, &Editor::external_audio_dialog));
|
||||
|
||||
|
||||
act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Add External Audio"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, X_("addExternalAudioAsRegion"), _("as Region(s)"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, X_("addExternalAudioAsTrack"), _("as Tracks"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsTrack));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, X_("addExternalAudioAsTapeTrack"), _("as Tape Tracks"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsTapeTrack));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, X_("addExternalAudioToTrack"), _("to Tracks"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportToTrack));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformVisibility"), _("Show Waveforms"), mem_fun (*this, &Editor::toggle_waveform_visibility));
|
||||
ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("Show Waveforms While Recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
|
||||
|
|
|
|||
|
|
@ -65,8 +65,21 @@ using Glib::ustring;
|
|||
/* Functions supporting the incorporation of external (non-captured) audio material into ardour */
|
||||
|
||||
void
|
||||
Editor::add_external_audio_action (ImportMode mode)
|
||||
Editor::add_external_audio_action (ImportMode mode_hint)
|
||||
{
|
||||
if (session == 0) {
|
||||
MessageDialog msg (0, _("You can't import or embed an audiofile until you have a session loaded."));
|
||||
msg.run ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (sfbrowser == 0) {
|
||||
sfbrowser = new SoundFileOmega (*this, _("Add existing audio"), session, 0, mode_hint);
|
||||
} else {
|
||||
sfbrowser->set_mode (mode_hint);
|
||||
}
|
||||
|
||||
external_audio_dialog ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -525,12 +525,13 @@ Editor::build_region_boundary_cache ()
|
|||
for (vector<RegionPoint>::iterator p = interesting_points.begin(); p != interesting_points.end(); ++p) {
|
||||
|
||||
if ((r = find_next_region (pos, *p, 1, tlist, &ontrack)) == 0) {
|
||||
if (*p == interesting_points.back()) {
|
||||
at_end = true;
|
||||
}
|
||||
/* move to next point type */
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
switch (*p) {
|
||||
case Start:
|
||||
rpos = r->first_frame();
|
||||
|
|
|
|||
|
|
@ -20,11 +20,13 @@
|
|||
#include <pbd/enumwriter.h>
|
||||
|
||||
#include "audio_clock.h"
|
||||
#include "editing.h"
|
||||
#include "enums.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
using namespace Editing;
|
||||
|
||||
void
|
||||
setup_gtk_ardour_enums ()
|
||||
|
|
@ -35,6 +37,7 @@ setup_gtk_ardour_enums ()
|
|||
|
||||
AudioClock::Mode clock_mode;
|
||||
Width width;
|
||||
ImportMode import_mode;
|
||||
|
||||
#define REGISTER(e) enum_writer.register_distinct (typeid(e).name(), i, s); i.clear(); s.clear()
|
||||
#define REGISTER_BITS(e) enum_writer.register_bits (typeid(e).name(), i, s); i.clear(); s.clear()
|
||||
|
|
@ -51,4 +54,10 @@ setup_gtk_ardour_enums ()
|
|||
REGISTER_ENUM (Wide);
|
||||
REGISTER_ENUM (Narrow);
|
||||
REGISTER (width);
|
||||
|
||||
REGISTER_ENUM (ImportAsTrack);
|
||||
REGISTER_ENUM (ImportToTrack);
|
||||
REGISTER_ENUM (ImportAsRegion);
|
||||
REGISTER_ENUM (ImportAsTapeTrack);
|
||||
REGISTER (import_mode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <pbd/convert.h>
|
||||
#include <pbd/tokenizer.h>
|
||||
#include <pbd/enumwriter.h>
|
||||
|
||||
#include <gtkmm2ext/utils.h>
|
||||
|
||||
|
|
@ -64,6 +65,39 @@ using Glib::ustring;
|
|||
|
||||
ustring SoundFileBrowser::persistent_folder;
|
||||
|
||||
static ImportMode
|
||||
string2importmode (string str)
|
||||
{
|
||||
if (str == "as new tracks") {
|
||||
return ImportAsTrack;
|
||||
} else if (str == "to selected tracks") {
|
||||
return ImportToTrack;
|
||||
} else if (str == "to region list") {
|
||||
return ImportAsRegion;
|
||||
} else if (str == "as new tape tracks") {
|
||||
return ImportAsTapeTrack;
|
||||
}
|
||||
|
||||
warning << string_compose (_("programming error: unknown import mode string %1"), str) << endmsg;
|
||||
|
||||
return ImportAsTrack;
|
||||
}
|
||||
|
||||
static string
|
||||
importmode2string (ImportMode mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case ImportAsTrack:
|
||||
return _("as new tracks");
|
||||
case ImportToTrack:
|
||||
return _("to selected tracks");
|
||||
case ImportAsRegion:
|
||||
return _("to region list");
|
||||
case ImportAsTapeTrack:
|
||||
return _("as new tape tracks");
|
||||
}
|
||||
}
|
||||
|
||||
SoundFileBox::SoundFileBox ()
|
||||
: _session(0),
|
||||
table (6, 2),
|
||||
|
|
@ -663,7 +697,7 @@ SoundFileOmega::reset_options ()
|
|||
switch (id) {
|
||||
case Editing::ImportDistinctFiles:
|
||||
if (selected_track_cnt == paths.size()) {
|
||||
action_strings.push_back (_("to selected tracks"));
|
||||
action_strings.push_back (importmode2string (ImportToTrack));
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -675,15 +709,15 @@ SoundFileOmega::reset_options ()
|
|||
break;
|
||||
|
||||
default:
|
||||
action_strings.push_back (_("to selected tracks"));
|
||||
action_strings.push_back (importmode2string (ImportToTrack));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
action_strings.push_back (_("as new tracks"));
|
||||
action_strings.push_back (_("to the region list"));
|
||||
action_strings.push_back (_("as new tape tracks"));
|
||||
action_strings.push_back (importmode2string (ImportAsTrack));
|
||||
action_strings.push_back (importmode2string (ImportAsRegion));
|
||||
action_strings.push_back (importmode2string (ImportAsTapeTrack));
|
||||
|
||||
resetting_ourselves = true;
|
||||
|
||||
|
|
@ -930,7 +964,7 @@ SoundFileChooser::get_filename ()
|
|||
return paths.front();
|
||||
}
|
||||
|
||||
SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Session* s, int selected_tracks)
|
||||
SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Session* s, int selected_tracks, Editing::ImportMode mode_hint)
|
||||
: SoundFileBrowser (parent, title, s),
|
||||
copy_files_btn ( _("Copy files to session")),
|
||||
selected_track_cnt (selected_tracks)
|
||||
|
|
@ -972,7 +1006,7 @@ SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Sessi
|
|||
*/
|
||||
|
||||
str.clear ();
|
||||
str.push_back (_("as new tracks"));
|
||||
str.push_back (importmode2string (mode_hint));
|
||||
set_popdown_strings (action_combo, str);
|
||||
action_combo.set_active_text (str.front());
|
||||
action_combo.set_sensitive (false);
|
||||
|
|
@ -1057,20 +1091,16 @@ SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Sessi
|
|||
chooser.signal_selection_changed().connect (mem_fun (*this, &SoundFileOmega::file_selection_changed));
|
||||
}
|
||||
|
||||
void
|
||||
SoundFileOmega::set_mode (ImportMode mode)
|
||||
{
|
||||
action_combo.set_active_text (importmode2string (mode));
|
||||
}
|
||||
|
||||
ImportMode
|
||||
SoundFileOmega::get_mode () const
|
||||
{
|
||||
ustring str = action_combo.get_active_text();
|
||||
|
||||
if (str == _("as new tracks")) {
|
||||
return ImportAsTrack;
|
||||
} else if (str == _("to the region list")) {
|
||||
return ImportAsRegion;
|
||||
} else if (str == _("to selected tracks")) {
|
||||
return ImportToTrack;
|
||||
} else {
|
||||
return ImportAsTapeTrack;
|
||||
}
|
||||
return string2importmode (action_combo.get_active_text());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -184,7 +184,8 @@ class SoundFileOmega : public SoundFileBrowser
|
|||
{
|
||||
|
||||
public:
|
||||
SoundFileOmega (Gtk::Window& parent, std::string title, ARDOUR::Session* _s, int selected_tracks);
|
||||
SoundFileOmega (Gtk::Window& parent, std::string title, ARDOUR::Session* _s, int selected_tracks,
|
||||
Editing::ImportMode mode_hint = Editing::ImportAsTrack);
|
||||
|
||||
void reset (int selected_tracks);
|
||||
|
||||
|
|
@ -195,6 +196,7 @@ class SoundFileOmega : public SoundFileBrowser
|
|||
|
||||
Gtk::CheckButton copy_files_btn;
|
||||
|
||||
void set_mode (Editing::ImportMode);
|
||||
Editing::ImportMode get_mode() const;
|
||||
Editing::ImportPosition get_position() const;
|
||||
Editing::ImportDisposition get_channel_disposition() const;
|
||||
|
|
|
|||
|
|
@ -98,8 +98,6 @@ MIDIControllable::stop_learning ()
|
|||
void
|
||||
MIDIControllable::drop_external_control ()
|
||||
{
|
||||
cerr << "Dropping existing control using " << connections << " connections\n";
|
||||
|
||||
if (connections > 0) {
|
||||
midi_sense_connection[0].disconnect ();
|
||||
}
|
||||
|
|
@ -286,8 +284,6 @@ MIDIControllable::bind_midi (channel_t chn, eventType ev, MIDI::byte additional)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
cerr << "MIDI bound with " << connections << endl;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue