Large nasty commit in the form of a 5000 line patch chock-full of completely

unecessary changes.  (Sorry, doing a "sprint" based thing, this is the end of the first one)

Achieved MIDI track and bus creation, associated Jack port and diskstream creation, and minimal GUI stuff for creating them.  Should be set to start work on actually recording and playing midi to/from disk now.

Relevant (significant) changes:

- Creation of a Buffer class.  Base class is type agnostic so things can point to a buffer but not care what kind it is (otherwise it'd be a template).  Derived into AudioBuffer and MidiBuffer, with a type tag because checking type is necessary in parts of the code where dynamic_cast wouldn't be wise.  Originally I considered this a hack, but passing around a type proved to be a very good solution to all the other problems (below).  There is a 1:1 mapping between jack port data types and ardour Buffer types (with a conversion function), but that's easily removed if it ever becomes necessary.  Having the type scoped in the Buffer class is maybe not the best spot for it, but whatever (this is proof of concept kinda stuff right now...)

- IO now has a "default" port type (passed to the constructor and stored as a member), used by ensure_io (and similar) to create n ports.  IO::register_***_port has a type argument that defaults to the default type if not passed.  Rationale:  previous IO API is identical, no changes needed to existing code, but path is paved for multiple port types in one IO, which we will need for eg synth plugin inserts, among other things.  This is not quite ideal (best would be to only have the two port register functions and have them take a type), but the alternative is a lot of work (namely destroying the 'ensure' functions and everything that uses them) for very little gain.  (I am convinced after quite a few tries at the whiteboard that subclassing IO in any way is not a feasible option, look at it's inheritance diagram in Doxygen and you can see why)

- AudioEngine::register_audio_input_port is now register_input_port and takes a type argument.  Ditto for output.

- (Most significant change) AudioDiskstream abstracted into Distream, and sibling MidiDiskstream created.  Very much still a work in progress, but Diskstream is there to switch references over to (most already are), which is the important part.  It is still unclear what the MIDI diskstream's relation to channels is, but I'm pretty sure they will be single channel only (so SMF Type 0) since noone can come up with a reason otherwise.

- MidiTrack creation.  Same thing as AudioTrack but with a different default type basically.  No big deal here.

- Random cleanups and variable renamings etc. because I have OCD and can't help myself. :)

Known broken:  Loading of sessions containing MIDI tracks.




git-svn-id: svn://localhost/ardour2/branches/midi@641 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2006-06-26 16:01:34 +00:00
parent 13532c8500
commit fe13d08874
194 changed files with 2354 additions and 903 deletions

View file

@ -26,7 +26,6 @@ gtkardour.Merge ([
libraries['ardour'],
libraries['ardour_cp'],
libraries['gtkmm2ext'],
# libraries['flowcanvas'],
libraries['midi++2'],
libraries['pbd3'],
libraries['gtkmm2'],
@ -62,6 +61,7 @@ skipped_files=Split("""
connection_editor.cc
""")
gtkardour_files=Split("""
about.cc
actions.cc
@ -181,6 +181,7 @@ visual_time_axis.cc
waveview.cc
""")
fft_analysis_files=Split("""
analysis_window.cc
fft_graph.cc

View file

@ -43,6 +43,7 @@ using namespace Gdk;
using namespace std;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
#ifdef WITH_PAYMENT_OPTIONS

View file

@ -39,6 +39,7 @@ using namespace std;
using namespace Gtk;
using namespace Glib;
using namespace sigc;
using namespace PBD;
vector<RefPtr<Gtk::Action> > ActionManager::session_sensitive_actions;
vector<RefPtr<Gtk::Action> > ActionManager::region_list_selection_sensitive_actions;

View file

@ -35,6 +35,7 @@ using namespace Gtk;
using namespace Gtkmm2ext;
using namespace sigc;
using namespace std;
using namespace PBD;
static const char* channel_setup_names[] = {
"Mono",
@ -44,6 +45,7 @@ static const char* channel_setup_names[] = {
"6 Channels",
"8 Channels",
"Manual Setup",
"MIDI",
0
};
@ -157,6 +159,13 @@ AddRouteDialog::track ()
return track_button.get_active ();
}
bool
AddRouteDialog::midi ()
{
const string str = channel_combo.get_active_text();
return (str == _("MIDI"));
}
string
AddRouteDialog::name_template ()
{
@ -192,7 +201,7 @@ AddRouteDialog::channels ()
string str = channel_combo.get_active_text();
int chns;
if (str == _("Mono")) {
if (str == _("Mono") || str == _("MIDI")) {
return 1;
} else if (str == _("Stereo")) {
return 2;

View file

@ -21,6 +21,7 @@ class AddRouteDialog : public Gtk::Dialog
~AddRouteDialog ();
bool track ();
bool midi ();
std::string name_template ();
int channels ();
int count ();

View file

@ -26,7 +26,7 @@
#include <gtkmm/treeiter.h>
#include <ardour/audioregion.h>
#include <ardour/playlist.h>
#include <ardour/audioplaylist.h>
#include <ardour/types.h>
#include "analysis_window.h"
@ -40,6 +40,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
AnalysisWindow::AnalysisWindow()
: ArdourDialog(_("analysis window")),
@ -229,7 +230,12 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
for (TrackSelection::iterator i = s.tracks.begin(); i != s.tracks.end(); ++i) {
ARDOUR::Playlist *pl = (*i)->playlist();
ARDOUR::AudioPlaylist *pl
= dynamic_cast<ARDOUR::AudioPlaylist*>((*i)->playlist());
if (!pl)
continue;
RouteUI *rui = dynamic_cast<RouteUI *>(*i);
// Busses don't have playlists, so we need to check that we actually are working with a playlist

View file

@ -56,6 +56,7 @@
#include <ardour/session_diskstream.h>
#include <ardour/port.h>
#include <ardour/audio_track.h>
#include <ardour/midi_track.h>
#include "actions.h"
#include "ardour_ui.h"
@ -76,6 +77,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtkmm2ext;
using namespace Gtk;
using namespace sigc;
@ -867,11 +869,51 @@ ARDOUR_UI::open_session ()
void
ARDOUR_UI::session_add_midi_track ()
ARDOUR_UI::session_add_midi_route (bool disk)
{
cerr << _("Patience is a virtue.\n");
Route* route;
if (session == 0) {
warning << _("You cannot add a track without a session already loaded.") << endmsg;
return;
}
try {
if (disk) {
if ((route = session->new_midi_track ()) == 0) {
error << _("could not create new MIDI track") << endmsg;
}
} else {
if ((route = session->new_midi_route ()) == 0) {
error << _("could not create new MIDI bus") << endmsg;
}
}
#if 0
#if CONTROLOUTS
if (need_control_room_outs) {
pan_t pans[2];
pans[0] = 0.5;
pans[1] = 0.5;
route->set_stereo_control_outs (control_lr_channels);
route->control_outs()->set_stereo_pan (pans, this);
}
#endif /* CONTROLOUTS */
#endif
}
catch (...) {
MessageDialog msg (*editor,
_("There are insufficient JACK ports available\n\
to create a new track or bus.\n\
You should save Ardour, exit and\n\
restart JACK with more ports."));
msg.run ();
}
}
void
ARDOUR_UI::session_add_audio_route (bool disk, int32_t input_channels, int32_t output_channels, ARDOUR::TrackMode mode)
{
@ -917,7 +959,7 @@ restart JACK with more ports."));
}
void
ARDOUR_UI::diskstream_added (AudioDiskstream* ds)
ARDOUR_UI::diskstream_added (Diskstream* ds)
{
}
@ -1164,11 +1206,14 @@ ARDOUR_UI::toggle_monitor_enable (guint32 dstream)
return;
}
AudioDiskstream *ds;
Diskstream *ds;
if ((ds = session->diskstream_by_id (dstream)) != 0) {
Port *port = ds->io()->input (0);
port->request_monitor_input (!port->monitoring_input());
AudioDiskstream *ads = dynamic_cast<AudioDiskstream*>(ds);
if (ads) {
Port *port = ds->io()->input (0);
port->request_monitor_input (!port->monitoring_input());
}
}
}
@ -1179,7 +1224,7 @@ ARDOUR_UI::toggle_record_enable (guint32 dstream)
return;
}
AudioDiskstream *ds;
Diskstream *ds;
if ((ds = session->diskstream_by_id (dstream)) != 0) {
ds->set_record_enabled (!ds->record_enabled(), this);
@ -2144,7 +2189,11 @@ ARDOUR_UI::add_route ()
/* XXX do something with name template */
while (count) {
if (track) {
if (track && add_route_dialog->midi()) {
session_add_midi_track();
} else if (add_route_dialog->midi()) {
session_add_midi_bus();
} else if (track) {
session_add_audio_track (input_chan, output_chan, add_route_dialog->mode());
} else {
session_add_audio_bus (input_chan, output_chan);

View file

@ -199,7 +199,13 @@ class ARDOUR_UI : public Gtkmm2ext::UI
session_add_audio_route (false, input_channels, output_channels, ARDOUR::Normal);
}
void session_add_midi_track ();
void session_add_midi_track () {
session_add_midi_route (true);
}
void session_add_midi_bus () {
session_add_midi_route (false);
}
void set_engine (ARDOUR::AudioEngine&);
@ -522,7 +528,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
sigc::connection point_one_second_connection;
sigc::connection point_zero_one_second_connection;
void diskstream_added (ARDOUR::AudioDiskstream*);
void diskstream_added (ARDOUR::Diskstream*);
gint session_menu (GdkEventButton *);
@ -538,6 +544,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void session_add_audio_route (bool disk, int32_t input_channels, int32_t output_channels, ARDOUR::TrackMode mode);
void session_add_midi_route (bool disk);
void add_diskstream_to_menu (ARDOUR::AudioDiskstream&);
void diskstream_selected (gint32);

View file

@ -47,6 +47,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtkmm2ext;
using namespace Gtk;
using namespace Glib;

View file

@ -36,6 +36,7 @@
using namespace sigc;
using namespace Gtk;
using namespace PBD;
namespace ARDOUR {
class Session;

View file

@ -39,6 +39,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Glib;
using namespace Gtk;
using namespace Gtkmm2ext;
@ -76,7 +77,7 @@ ARDOUR_UI::connect_to_session (Session *s)
shuttle_box.set_sensitive (true);
if (session->n_audio_diskstreams() == 0) {
session->AudioDiskstreamAdded.connect (mem_fun(*this, &ARDOUR_UI::diskstream_added));
session->DiskstreamAdded.connect (mem_fun(*this, &ARDOUR_UI::diskstream_added));
}
if (connection_editor) {

View file

@ -40,6 +40,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Gtkmm2ext;
@ -190,13 +191,17 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (common_actions, X_("ToggleBigClock"), _("Big Clock"), mem_fun(*this, &ARDOUR_UI::toggle_big_clock_window));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::register_action (common_actions, X_("About"), _("About"), mem_fun(*this, &ARDOUR_UI::show_splash));
act = ActionManager::register_action (common_actions, X_("About"), _("About"), mem_fun(*this, &ARDOUR_UI::show_splash));
act = ActionManager::register_toggle_action (common_actions, X_("ToggleColorManager"), _("Colors"), mem_fun(*this, &ARDOUR_UI::toggle_color_manager));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("AddAudioTrack"), _("Add Audio Track"), bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_track), 1, 1, ARDOUR::Normal));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("AddAudioBus"), _("Add Audio Bus"), bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_bus), 1, 1));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("AddMIDITrack"), _("Add MIDI Track"), (mem_fun(*this, &ARDOUR_UI::session_add_midi_track)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("AddMidiBus"), _("Add Midi Bus"), mem_fun(*this, &ARDOUR_UI::session_add_midi_bus));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("Save"), _("Save"), bind (mem_fun(*this, &ARDOUR_UI::save_state), string("")));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("RemoveLastCapture"), _("Remove Last Capture"), mem_fun(*this, &ARDOUR_UI::remove_last_capture));

View file

@ -28,6 +28,7 @@
#include "mixer_ui.h"
using namespace ARDOUR;
using namespace PBD;
int
ARDOUR_UI::create_mixer ()

View file

@ -35,6 +35,7 @@
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace ARDOUR;
using namespace PBD;
void
ARDOUR_UI::setup_config_options ()

View file

@ -6,4 +6,4 @@ if [ gprofhelper.c -nt gprofhelper.so ] ; then
fi
export LD_LIBRARY_PATH=../libs/ardour/.libs
LDPRELOAD=./gprofhelper.so ./ardour $*
LDPRELOAD=./gprofhelper.so ./ardev $*

View file

@ -37,6 +37,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;

View file

@ -80,6 +80,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace LADSPA;
using namespace Gtk;
using namespace Editing;
@ -378,7 +379,7 @@ AudioTimeAxisView::playlist_changed ()
label_view ();
if (is_audio_track()) {
set_playlist (get_diskstream()->playlist());
set_playlist (dynamic_cast<AudioPlaylist*>(get_diskstream()->playlist()));
}
}
@ -825,7 +826,8 @@ AudioTimeAxisView::rename_current_playlist ()
AudioPlaylist *pl;
AudioDiskstream *ds;
if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
if (((ds = get_diskstream()) == 0) || ds->destructive()
|| ((pl = dynamic_cast<AudioPlaylist*>(ds->playlist())) == 0)) {
return;
}
@ -854,7 +856,8 @@ AudioTimeAxisView::use_copy_playlist (bool prompt)
AudioDiskstream *ds;
string name;
if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
if (((ds = get_diskstream()) == 0) || ds->destructive()
|| ((pl = dynamic_cast<AudioPlaylist*>(ds->playlist())) == 0)) {
return;
}
@ -882,7 +885,7 @@ AudioTimeAxisView::use_copy_playlist (bool prompt)
if (name.length()) {
ds->use_copy_playlist ();
pl = ds->playlist();
pl = dynamic_cast<AudioPlaylist*>(ds->playlist());
pl->set_name (name);
}
}
@ -894,7 +897,8 @@ AudioTimeAxisView::use_new_playlist (bool prompt)
AudioDiskstream *ds;
string name;
if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
if (((ds = get_diskstream()) == 0) || ds->destructive()
|| ((pl = dynamic_cast<AudioPlaylist*>(ds->playlist())) == 0)) {
return;
}
@ -921,7 +925,7 @@ AudioTimeAxisView::use_new_playlist (bool prompt)
if (name.length()) {
ds->use_new_playlist ();
pl = ds->playlist();
pl = dynamic_cast<AudioPlaylist*>(ds->playlist());
pl->set_name (name);
}
}
@ -933,7 +937,7 @@ AudioTimeAxisView::clear_playlist ()
AudioDiskstream *ds;
if ((ds = get_diskstream()) != 0) {
if ((pl = ds->playlist()) != 0) {
if ((pl = dynamic_cast<AudioPlaylist*>(ds->playlist())) != 0) {
editor.clear_playlist (*pl);
}
}
@ -991,7 +995,7 @@ AudioTimeAxisView::update_diskstream_display ()
AudioDiskstream *ds;
if ((ds = get_diskstream()) != 0) {
set_playlist (ds->playlist ());
set_playlist (dynamic_cast<AudioPlaylist*> (ds->playlist ()));
}
map_frozen ();
@ -1143,7 +1147,7 @@ Region*
AudioTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
{
AudioDiskstream *stream;
AudioPlaylist *playlist;
Playlist *playlist;
if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
return playlist->find_next_region (pos, point, dir);

View file

@ -31,6 +31,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
AutomationGainLine::AutomationGainLine (const string & name, Session& s, TimeAxisView& tv, ArdourCanvas::Group& parent, Curve& c)

View file

@ -48,6 +48,7 @@
using namespace std;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
using namespace Gnome; // for Canvas

View file

@ -31,6 +31,7 @@
#include <ardour/session.h>
using namespace ARDOUR;
using namespace PBD;
AutomationPanLine::AutomationPanLine (const string & name, Session& s, TimeAxisView& tv, ArdourCanvas::Group& parent, Curve& c)

View file

@ -16,6 +16,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Editing;

View file

@ -12,6 +12,7 @@
using namespace std;
using namespace Gtk;
using namespace PBD;
/* the global color map */

View file

@ -43,6 +43,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace sigc;

View file

@ -52,6 +52,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace sigc;
using namespace Editing;

View file

@ -35,6 +35,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
using namespace Gnome;
using namespace Canvas;

View file

@ -7,6 +7,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
int
curvetest (string filename)

View file

@ -84,6 +84,7 @@
using namespace std;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Glib;
using namespace Gtkmm2ext;
@ -3120,7 +3121,7 @@ Editor::mapped_set_selected_regionview_from_click (AudioTimeAxisView& atv, uint3
}
if ((pl = ds->playlist()) != 0) {
if ((pl = dynamic_cast<AudioPlaylist*>(ds->playlist())) != 0) {
pl->get_equivalent_regions (basis->region, results);
}
@ -3345,7 +3346,7 @@ Editor::set_selected_regionview_from_region_list (Region& r, Selection::Operatio
continue;
}
if ((pl = ds->playlist()) != 0) {
if ((pl = dynamic_cast<AudioPlaylist*>(ds->playlist())) != 0) {
pl->get_region_list_equivalent_regions (*region, results);
}

View file

@ -69,6 +69,7 @@ namespace ARDOUR {
class AudioDiskstream;
class RouteGroup;
class Playlist;
class AudioPlaylist;
class Region;
class Location;
class TempoSection;
@ -1600,7 +1601,7 @@ class Editor : public PublicEditor
void external_edit_region ();
int write_audio_selection (TimeSelection&);
bool write_audio_range (ARDOUR::Playlist&, uint32_t channels, list<ARDOUR::AudioRange>&);
bool write_audio_range (ARDOUR::AudioPlaylist&, uint32_t channels, list<ARDOUR::AudioRange>&);
void write_selection ();

View file

@ -12,6 +12,7 @@ using namespace Glib;
using namespace std;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
void

View file

@ -42,6 +42,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;
using namespace Editing;

View file

@ -8,6 +8,7 @@
#include "selection.h"
using namespace ARDOUR;
using namespace PBD;
void
Editor::set_route_loop_selection ()

View file

@ -46,6 +46,7 @@
using namespace std;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Glib;
using namespace Gtkmm2ext;

View file

@ -42,6 +42,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
bool
@ -511,22 +512,25 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
if ((atv = dynamic_cast<AudioTimeAxisView*>(&tv)) != 0) {
if (atv->is_audio_track()) {
AudioPlaylist* pl = atv->get_diskstream()->playlist();
Playlist::RegionList* rl = pl->regions_at (event_frame (event));
if (!rl->empty()) {
DescendingRegionLayerSorter cmp;
rl->sort (cmp);
AudioPlaylist* pl;
if ((pl = dynamic_cast<AudioPlaylist*> (atv->get_diskstream()->playlist())) != 0) {
AudioRegionView* arv = atv->view->find_view (*(dynamic_cast<AudioRegion*> (rl->front())));
Playlist::RegionList* rl = pl->regions_at (event_frame (event));
/* proxy */
delete rl;
if (!rl->empty()) {
DescendingRegionLayerSorter cmp;
rl->sort (cmp);
return canvas_region_view_event (event, arv->get_canvas_group(), arv);
}
AudioRegionView* arv = atv->view->find_view (*(dynamic_cast<AudioRegion*> (rl->front())));
/* proxy */
delete rl;
return canvas_region_view_event (event, arv->get_canvas_group(), arv);
}
}
}
}

View file

@ -28,6 +28,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
Editor::Cursor::Cursor (Editor& ed, const string& color, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*))

View file

@ -38,6 +38,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
void

View file

@ -46,6 +46,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
void
@ -286,7 +287,7 @@ Editor::write_audio_selection (TimeSelection& ts)
if (atv->is_audio_track()) {
Playlist* playlist = atv->get_diskstream()->playlist();
AudioPlaylist* playlist = dynamic_cast<AudioPlaylist*>(atv->get_diskstream()->playlist());
if (playlist && write_audio_range (*playlist, atv->get_diskstream()->n_channels(), ts) == 0) {
ret = -1;
@ -299,7 +300,7 @@ Editor::write_audio_selection (TimeSelection& ts)
}
bool
Editor::write_audio_range (Playlist& playlist, uint32_t channels, list<AudioRange>& range)
Editor::write_audio_range (AudioPlaylist& playlist, uint32_t channels, list<AudioRange>& range)
{
AudioFileSource* fs;
const jack_nframes_t chunk_size = 4096;

View file

@ -24,6 +24,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
void
Editor::hscrollbar_allocate (Gtk::Allocation &alloc)

View file

@ -44,6 +44,7 @@
#include "public_editor.h"
using namespace Gtk;
using namespace PBD;
/* <CMT Additions file="editor.cc"> */

View file

@ -36,6 +36,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
void

View file

@ -41,6 +41,7 @@
using namespace std;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
void

View file

@ -61,6 +61,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;
using namespace Editing;
@ -3197,7 +3198,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (&rv->get_time_axis_view());
if (atv && atv->is_audio_track()) {
AudioPlaylist* pl = atv->get_diskstream()->playlist();
AudioPlaylist* pl = dynamic_cast<AudioPlaylist*>(atv->get_diskstream()->playlist());
if (pl) {
/* only freeze and capture state once */

View file

@ -27,4 +27,5 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;

View file

@ -64,6 +64,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;
using namespace Editing;

View file

@ -42,6 +42,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Glib;
using namespace Editing;

View file

@ -35,6 +35,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
void

View file

@ -35,6 +35,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Editing;

View file

@ -40,6 +40,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Gtkmm2ext;

View file

@ -49,6 +49,7 @@
using namespace std;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace Editing;

View file

@ -41,6 +41,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;

View file

@ -49,6 +49,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;

View file

@ -32,6 +32,7 @@
using namespace Gtk;
using namespace ARDOUR;
using namespace PBD;
using namespace std;
ExportRangeMarkersDialog::ExportRangeMarkersDialog (PublicEditor& editor)

View file

@ -28,6 +28,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
GainAutomationTimeAxisView::GainAutomationTimeAxisView (Session& s, Route& r, PublicEditor& e, TimeAxisView& parent, ArdourCanvas::Canvas& canvas, const string & n, ARDOUR::Curve& c)

View file

@ -47,6 +47,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtkmm2ext;
using namespace Gtk;
using namespace sigc;

View file

@ -52,6 +52,7 @@ using namespace std;
using namespace ardourvis ;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
ImageFrameSocketHandler* ImageFrameSocketHandler::_instance = 0 ;

View file

@ -47,6 +47,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;

View file

@ -49,6 +49,7 @@ using namespace Gtk;
using namespace Glib;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtkmm2ext;
IOSelectorWindow::IOSelectorWindow (Session& sess, IO& ior, bool input, bool can_cancel)

View file

@ -35,6 +35,8 @@
#include "i18n.h"
using namespace PBD;
#define KBD_DEBUG 1
bool debug_keyboard = false;

View file

@ -38,6 +38,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Gtkmm2ext;

View file

@ -53,6 +53,7 @@
using namespace Gtk;
using namespace GTK_ARDOUR;
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
TextReceiver text_receiver ("ardour");
@ -102,12 +103,6 @@ handler (int sig)
shutdown (1);
}
static void
handler2 (int sig, siginfo_t* ctxt, void* ignored)
{
handler (sig);
}
static void *
signal_thread (void *arg)
{
@ -361,9 +356,17 @@ To create it from the command line, start ardour as \"ardour --new %1"), path)
return true;
}
#ifdef VST_SUPPORT
/* this is called from the entry point of a wine-compiled
executable that is linked against gtk2_ardour built
as a shared library.
*/
extern "C" {
int ardour_main (int argc, char *argv[])
#else
int main (int argc, char *argv[])
#endif
int
main (int argc, char *argv[])
{
ARDOUR::AudioEngine *engine;
vector<Glib::ustring> null_file_list;
@ -443,7 +446,7 @@ main (int argc, char *argv[])
try {
engine = new ARDOUR::AudioEngine (jack_client_name);
ARDOUR::init (*engine, use_vst, try_hw_optimization, handler2);
ARDOUR::init (*engine, use_vst, try_hw_optimization);
ui->set_engine (*engine);
} catch (AudioEngine::NoBackendAvailable& err) {
gui_jack_error ();
@ -463,6 +466,9 @@ main (int argc, char *argv[])
ARDOUR::cleanup ();
shutdown (0);
/* just another commit forcing change */
return 0;
}
#ifdef VST_SUPPORT
} // end of extern C block
#endif

View file

@ -42,6 +42,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;

View file

@ -32,6 +32,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace sigc;

View file

@ -40,6 +40,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Gtkmm2ext;

View file

@ -63,6 +63,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Gtkmm2ext;

View file

@ -49,6 +49,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Glib;
using namespace Gtkmm2ext;

View file

@ -43,6 +43,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Editing;
using namespace Gtkmm2ext;

View file

@ -31,6 +31,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
PanAutomationTimeAxisView::PanAutomationTimeAxisView (Session& s, Route& r, PublicEditor& e, TimeAxisView& parent, Canvas& canvas, std::string n)

View file

@ -39,6 +39,7 @@ using namespace std;
using namespace Gtk;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
Panner2d::Target::Target (float xa, float ya, const char *txt)
: x (xa), y (ya), text (txt ? strdup (txt) : 0)

View file

@ -41,6 +41,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtkmm2ext;
using namespace Gtk;
using namespace sigc;

View file

@ -40,6 +40,7 @@ using namespace std;
using namespace sigc;
using namespace Gtk;
using namespace ARDOUR;
using namespace PBD;
PlaylistSelector::PlaylistSelector ()
: ArdourDialog ("playlist selector")
@ -115,7 +116,7 @@ PlaylistSelector::show_for (RouteUI* ruix)
for (DSPL_Map::iterator x = dspl_map.begin(); x != dspl_map.end(); ++x) {
AudioDiskstream* ds = session->diskstream_by_id (x->first);
Diskstream* ds = session->diskstream_by_id (x->first);
if (ds == 0) {
continue;

View file

@ -36,6 +36,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
PluginSelector::PluginSelector (PluginManager *mgr)
@ -149,6 +150,9 @@ PluginSelector::PluginSelector (PluginManager *mgr)
added_list.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::added_list_selection_changed));
input_refiller ();
#ifdef VST_SUPPORT
vst_refiller ();
#endif
}
void
@ -306,6 +310,9 @@ PluginSelector::btn_update_clicked()
{
manager->refresh ();
input_refiller ();
#ifdef VST_SUPPORT
vst_refiller ();
#endif
}
#ifdef VST_SUPPORT

View file

@ -56,6 +56,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtkmm2ext;
using namespace Gtk;
using namespace sigc;

View file

@ -228,7 +228,7 @@ class VSTPluginUI : public PlugUIBase, public Gtk::VBox
Gtk::HBox preset_box;
Gtk::VBox vpacker;
gboolean configure_handler (GdkEventConfigure*, Gtk::Socket*);
bool configure_handler (GdkEventConfigure*, Gtk::Socket*);
void save_plugin_setting ();
};
#endif

View file

@ -32,6 +32,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
RedirectAutomationLine::RedirectAutomationLine (const string & name, Redirect& rd, uint32_t port, Session& s,

View file

@ -29,6 +29,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
RedirectAutomationTimeAxisView::RedirectAutomationTimeAxisView (Session& s, Route& r, PublicEditor& e, TimeAxisView& parent, Canvas& canvas, std::string n,

View file

@ -65,6 +65,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace Glib;
using namespace Gtkmm2ext;

View file

@ -33,6 +33,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace std;

View file

@ -16,6 +16,7 @@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
AudioRegionGainLine::AudioRegionGainLine (const string & name, Session& s, AudioRegionView& r, ArdourCanvas::Group& parent, Curve& c)
: AutomationLine (name, r.get_time_axis_view(), parent, c),

View file

@ -6,6 +6,7 @@
#include "region_selection.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;

View file

@ -49,6 +49,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
using namespace ArdourCanvas;

View file

@ -52,6 +52,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
using namespace sigc;

View file

@ -31,6 +31,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
RouteRedirectSelection&

View file

@ -41,6 +41,7 @@ using namespace sigc;
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace ARDOUR;
using namespace PBD;
RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name,

View file

@ -33,6 +33,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
struct AudioRangeComparator {

View file

@ -28,6 +28,7 @@
#include "gui_thread.h"
using namespace ARDOUR;
using namespace PBD;
SendUI::SendUI (Send& s, Session& se)
: _send (s),

View file

@ -42,6 +42,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace std;
SoundFileBox::SoundFileBox ()

View file

@ -29,6 +29,7 @@
#include "color.h"
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
StreamView::StreamView (AudioTimeAxisView& tv)
@ -361,7 +362,9 @@ StreamView::playlist_changed (AudioDiskstream *ds)
playlist_connections.push_back (ds->playlist()->RegionRemoved.connect (mem_fun (*this, &StreamView::remove_region_view)));
playlist_connections.push_back (ds->playlist()->StateChanged.connect (mem_fun (*this, &StreamView::playlist_state_changed)));
playlist_connections.push_back (ds->playlist()->Modified.connect (mem_fun (*this, &StreamView::playlist_modified)));
playlist_connections.push_back (ds->playlist()->NewCrossfade.connect (mem_fun (*this, &StreamView::add_crossfade)));
AudioPlaylist* apl = dynamic_cast<AudioPlaylist*>(ds->playlist());
if (apl)
playlist_connections.push_back (apl->NewCrossfade.connect (mem_fun (*this, &StreamView::add_crossfade)));
}
void
@ -454,7 +457,9 @@ StreamView::redisplay_diskstream ()
if (_trackview.is_audio_track()) {
_trackview.get_diskstream()->playlist()->foreach_region (this, &StreamView::add_region_view);
_trackview.get_diskstream()->playlist()->foreach_crossfade (this, &StreamView::add_crossfade);
AudioPlaylist* apl = dynamic_cast<AudioPlaylist*>(_trackview.get_diskstream()->playlist());
if (apl)
apl->foreach_crossfade (this, &StreamView::add_crossfade);
}
for (i = region_views.begin(); i != region_views.end(); ) {

View file

@ -38,6 +38,7 @@
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
using namespace ArdourCanvas;

View file

@ -11,6 +11,7 @@
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace ARDOUR;
using namespace PBD;
TempoDialog::TempoDialog (TempoMap& map, jack_nframes_t frame, const string & action)
: ArdourDialog ("tempo dialog"),

View file

@ -55,6 +55,7 @@ using namespace Gtk;
using namespace Gdk;
using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
using namespace ArdourCanvas;

View file

@ -38,6 +38,7 @@
using namespace std;
using namespace Editing;
using namespace Glib;
using namespace PBD;
//------------------------------------------------------------------------------
/** Initialize const static memeber data */

View file

@ -28,6 +28,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
AudioRange&
TimeSelection::operator[] (uint32_t which)

View file

@ -43,6 +43,7 @@ using namespace std;
using namespace Gtk;
using namespace sigc;
using namespace Glib;
using namespace PBD;
ustring
fit_to_pixels (const ustring& str, int pixel_width, Pango::FontDescription& font, int& actual_width)

View file

@ -55,6 +55,7 @@
#include "i18n.h"
using namespace ARDOUR;
using namespace PBD;
using namespace sigc;
using namespace Gtk;

View file

@ -19,7 +19,7 @@
*/
#include <fst.h>
#include <gtk/gtksocket.h>
#include <ardour/insert.h>
#include <ardour/vst_plugin.h>
@ -29,6 +29,7 @@
using namespace Gtk;
using namespace ARDOUR;
using namespace PBD;
VSTPluginUI::VSTPluginUI (PluginInsert& pi, VSTPlugin& vp)
: PlugUIBase (pi),
@ -60,16 +61,12 @@ VSTPluginUI::get_preferred_height ()
int
VSTPluginUI::package (Gtk::Window& win)
{
/* for GTK+2, remove this: you cannot add to a realized socket */
//socket.realize ();
/* forward configure events to plugin window */
win.signal_configure_event().connect (bind (mem_fun (*this, &VSTPluginUI::configure_handler), &socket));
win.signal_configure_event().connect (bind (mem_fun (*this, &VSTPluginUI::configure_handler), &socket), false);
/* XXX in GTK2, use add_id() instead of steal, although add_id()
assumes that the window's owner understands the XEmbed protocol.
/*
this assumes that the window's owner understands the XEmbed protocol.
*/
socket.add_id (fst_get_XID (vst.fst()));
@ -77,45 +74,42 @@ VSTPluginUI::package (Gtk::Window& win)
return 0;
}
gboolean
bool
VSTPluginUI::configure_handler (GdkEventConfigure* ev, Gtk::Socket *socket)
{
XEvent event;
gint x, y;
GdkWindow* w;
if (socket->gobj() == NULL) {
return FALSE;
if (socket == 0 || ((w = socket->gobj()->plug_window) == 0)) {
return false;
}
event.xconfigure.type = ConfigureNotify;
event.xconfigure.event = GDK_WINDOW_XWINDOW (socket->get_window()->gobj());
event.xconfigure.window = GDK_WINDOW_XWINDOW (socket->get_window()->gobj());
event.xconfigure.event = GDK_WINDOW_XWINDOW (w);
event.xconfigure.window = GDK_WINDOW_XWINDOW (w);
/* The ICCCM says that synthetic events should have root relative
* coordinates. We still aren't really ICCCM compliant, since
* we don't send events when the real toplevel is moved.
*/
gdk_error_trap_push ();
gdk_window_get_origin (socket->get_window()->gobj(), &x, &y);
gdk_window_get_origin (w, &x, &y);
gdk_error_trap_pop ();
event.xconfigure.x = x;
event.xconfigure.y = y;
event.xconfigure.width = GTK_WIDGET(socket)->allocation.width;
event.xconfigure.height = GTK_WIDGET(socket)->allocation.height;
event.xconfigure.width = GTK_WIDGET(socket->gobj())->allocation.width;
event.xconfigure.height = GTK_WIDGET(socket->gobj())->allocation.height;
event.xconfigure.border_width = 0;
event.xconfigure.above = None;
event.xconfigure.override_redirect = False;
gdk_error_trap_push ();
XSendEvent (GDK_WINDOW_XDISPLAY (socket->get_window()->gobj()),
GDK_WINDOW_XWINDOW (socket->get_window()->gobj()),
False, StructureNotifyMask, &event);
// gdk_display_sync (GDK_WINDOW_XDISPLAY (socket->plug_window));
XSendEvent (GDK_WINDOW_XDISPLAY (w), GDK_WINDOW_XWINDOW (w), False, StructureNotifyMask, &event);
gdk_error_trap_pop ();
return FALSE;
return false;
}