merge resolution with master

This commit is contained in:
Paul Davis 2013-05-02 20:21:54 -04:00
commit e2f0c5f91e
66 changed files with 255 additions and 4024 deletions

View file

@ -60,7 +60,6 @@ AddRouteDialog::AddRouteDialog (Session* s)
set_session (s);
set_name ("AddRouteDialog");
set_position (Gtk::WIN_POS_MOUSE);
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (false);

View file

@ -68,7 +68,6 @@ AddVideoDialog::AddVideoDialog (Session* s)
{
set_session (s);
set_name ("AddVideoDialog");
set_position (Gtk::WIN_POS_MOUSE);
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (true);

View file

@ -34,12 +34,15 @@ sigc::signal<void> ArdourDialog::CloseAllDialogs;
ArdourDialog::ArdourDialog (string title, bool modal, bool use_seperator)
: Dialog (title, modal, use_seperator)
, _splash_pushed (false)
{
init ();
set_position (Gtk::WIN_POS_MOUSE);
}
ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool use_seperator)
: Dialog (title, parent, modal, use_seperator)
, _splash_pushed (false)
{
init ();
set_position (Gtk::WIN_POS_CENTER_ON_PARENT);
@ -47,6 +50,13 @@ ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool
ArdourDialog::~ArdourDialog ()
{
if (_splash_pushed) {
Splash* spl = Splash::instance();
if (spl) {
spl->pop_front();
}
}
}
bool
@ -73,15 +83,16 @@ ArdourDialog::on_unmap ()
void
ArdourDialog::on_show ()
{
Dialog::on_show ();
// never allow the splash screen to obscure any dialog
Splash* spl = Splash::instance();
if (spl) {
if (spl && spl->is_visible()) {
spl->pop_back_for (*this);
_splash_pushed = true;
}
Dialog::on_show ();
}
void

View file

@ -46,6 +46,7 @@ class ArdourDialog : public Gtk::Dialog, public ARDOUR::SessionHandlePtr
static void close_all_dialogs () { CloseAllDialogs(); }
private:
bool _splash_pushed;
void init ();
static sigc::signal<void> CloseAllDialogs;

View file

@ -933,7 +933,6 @@ ARDOUR_UI::ask_about_saving_session (const vector<string>& actions)
window.get_vbox()->pack_start (dhbox);
window.set_name (_("Prompter"));
window.set_position (Gtk::WIN_POS_MOUSE);
window.set_modal (true);
window.set_resizable (false);
@ -1367,8 +1366,6 @@ ARDOUR_UI::open_recent_session ()
while (true) {
session_selector_window->set_position (WIN_POS_MOUSE);
ResponseType r = (ResponseType) session_selector_window->run ();
switch (r) {
@ -3246,7 +3243,6 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
if (add_route_dialog == 0) {
add_route_dialog = new AddRouteDialog (_session);
add_route_dialog->set_position (WIN_POS_MOUSE);
if (float_window) {
add_route_dialog->set_transient_for (*float_window);
}
@ -3771,12 +3767,14 @@ audio may be played at the wrong sample rate.\n"), desired, PROGRAM_NAME, actual
image->show();
hbox->show();
switch (dialog.run ()) {
switch (dialog.run()) {
case RESPONSE_ACCEPT:
return 0;
default:
return 1;
break;
}
return 1;
}

View file

@ -142,17 +142,6 @@ ARDOUR_UI::install_actions ()
sigc::mem_fun (*editor, &PublicEditor::export_video));
ActionManager::session_sensitive_actions.push_back (act);
#ifdef WITH_CMT
std::string anicomp_file_path;
if (PBD::find_file_in_search_path (Glib::getenv("PATH"), "AniComp", anicomp_file_path)) {
act = ActionManager::register_action (main_actions, X_("aniConnect"), _("Connect"), (sigc::mem_fun (*editor, &PublicEditor::connect_to_image_compositor)));
ActionManager::session_sensitive_actions.push_back (act);
}
#endif
act = ActionManager::register_action (main_actions, X_("Snapshot"), _("Snapshot..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);

View file

@ -35,6 +35,7 @@ ArdourWindow::ArdourWindow (string title)
{
set_title (title);
init ();
set_position (Gtk::WIN_POS_MOUSE);
}
ArdourWindow::ArdourWindow (Gtk::Window& parent, string /*title*/)
@ -75,5 +76,15 @@ void
ArdourWindow::init ()
{
set_border_width (10);
/* ArdourWindows are not dialogs (they have no "OK" or "Close" button) but
they should be considered part of the same "window level" as a dialog. This
works on X11 and Quartz, in that:
(a) utility & dialog windows are considered to be part of the same level
(b) they will float above normal windows without any particular effort
*/
set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
}

View file

@ -76,9 +76,6 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
void lower_box_realized ();
void cocoa_view_resized ();
void on_realize ();
bool on_map_event (GdkEventAny*);
bool on_focus_in_event (GdkEventFocus*);
bool on_focus_out_event (GdkEventFocus*);
void forward_key_event (GdkEventKey*);
bool on_window_show (const std::string& /*title*/);
@ -93,7 +90,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
int prefwidth;
Gtk::HBox top_box;
Gtk::EventBox low_box;
Gtk::HBox low_box;
Gtk::VBox vpacker;
Gtk::Label automation_mode_label;
Gtk::ComboBoxText automation_mode_selector;
@ -105,6 +102,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
NSWindow* cocoa_window;
NSView* au_view;
NSRect last_au_frame;
/* Carbon */

View file

@ -1,5 +1,3 @@
#include <gtkmm/stock.h>
#undef Marker
#define Marker FuckYouAppleAndYourLackOfNameSpaces
@ -50,6 +48,26 @@ static const gchar* _automation_mode_strings[] = {
0
};
static void
dump_view_tree (NSView* view, int depth)
{
NSArray* subviews = [view subviews];
unsigned long cnt = [subviews count];
for (int d = 0; d < depth; d++) {
cerr << '\t';
}
NSRect frame = [view frame];
cerr << " view @ " << frame.origin.x << ", " << frame.origin.y
<< ' ' << frame.size.width << " x " << frame.size.height
<< endl;
for (unsigned long i = 0; i < cnt; ++i) {
NSView* subview = [subviews objectAtIndex:i];
dump_view_tree (subview, depth+1);
}
}
@implementation NotificationObject
- (NotificationObject*) initWithPluginUI: (AUPluginUI*) apluginui andCocoaParent: (NSWindow*) cp andTopLevelParent: (NSWindow*) tlp
@ -170,13 +188,16 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
top_box.show ();
low_box.show ();
_activating_from_app = false;
cocoa_parent = 0;
_notify = 0;
cocoa_window = 0;
carbon_window = 0;
#ifdef WITH_CARBBON
_activating_from_app = false;
_notify = 0;
au_view = 0;
editView = 0;
carbon_window = 0;
#endif
/* prefer cocoa, fall back to cocoa, but use carbon if its there */
@ -227,6 +248,7 @@ AUPluginUI::~AUPluginUI ()
bool
AUPluginUI::test_carbon_view_support ()
{
#ifdef WITH_CARBON
bool ret = false;
carbon_descriptor.componentType = kAudioUnitCarbonViewComponentType;
@ -253,6 +275,9 @@ AUPluginUI::test_carbon_view_support ()
}
return ret;
#else
return false;
#endif
}
bool
@ -282,7 +307,7 @@ AUPluginUI::plugin_class_valid (Class pluginClass)
int
AUPluginUI::create_cocoa_view ()
{
BOOL wasAbleToLoadCustomView = NO;
bool wasAbleToLoadCustomView = false;
AudioUnitCocoaViewInfo* cocoaViewInfo = NULL;
UInt32 numberOfClasses = 0;
UInt32 dataSize;
@ -380,7 +405,7 @@ AUPluginUI::create_cocoa_view ()
free (cocoaViewInfo);
}
wasAbleToLoadCustomView = YES;
wasAbleToLoadCustomView = true;
}
}
@ -390,14 +415,16 @@ AUPluginUI::create_cocoa_view ()
au->get_au()));
au_view = [[AUGenericView alloc] initWithAudioUnit:*au->get_au()];
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("view created @ %1\n", au_view));
[(AUGenericView *)au_view setShowsExpertParameters:YES];
[(AUGenericView *)au_view setShowsExpertParameters:1];
}
// Get the initial size of the new AU View's frame
NSRect rect = [au_view frame];
prefheight = rect.size.height;
prefwidth = rect.size.width;
low_box.set_size_request (rect.size.width, rect.size.height);
return 0;
}
@ -406,14 +433,11 @@ AUPluginUI::cocoa_view_resized ()
{
GtkRequisition topsize = top_box.size_request ();
NSWindow* window = get_nswindow ();
NSSize oldContentSize= [window contentRectForFrameRect:[window frame]].size;
NSSize newContentSize= [au_view frame].size;
NSRect windowFrame= [window frame];
oldContentSize.height -= topsize.height;
NSRect new_frame = [au_view frame];
float dy = oldContentSize.height - newContentSize.height;
float dx = oldContentSize.width - newContentSize.width;
float dy = last_au_frame.size.height - new_frame.size.height;
float dx = last_au_frame.size.width - new_frame.size.width;
windowFrame.origin.y += dy;
windowFrame.origin.x += dx;
@ -427,12 +451,30 @@ AUPluginUI::cocoa_view_resized ()
NSUInteger old_auto_resize = [au_view autoresizingMask];
[au_view setAutoresizingMask:NSViewNotSizable];
[window setFrame:windowFrame display:YES];
[window setFrame:windowFrame display:1];
/* Some stupid AU Views change the origin of the original AU View
when they are resized (I'm looking at you AUSampler). If the origin
has been moved, move it back.
*/
if (last_au_frame.origin.x != new_frame.origin.x ||
last_au_frame.origin.y != new_frame.origin.y) {
new_frame.origin = last_au_frame.origin;
[au_view setFrame:new_frame];
/* also be sure to redraw the topbox because this can
also go wrong.
*/
top_box.queue_draw ();
}
[au_view setAutoresizingMask:old_auto_resize];
[[NSNotificationCenter defaultCenter] addObserver:_notify
selector:@selector(auViewResized:) name:NSViewFrameDidChangeNotification
object:au_view];
last_au_frame = new_frame;
}
int
@ -526,7 +568,6 @@ AUPluginUI::activate ()
#ifdef WITH_CARBON
ActivateWindow (carbon_window, TRUE);
#endif
// [cocoa_parent makeKeyAndOrderFront:nil];
}
void
@ -603,7 +644,7 @@ AUPluginUI::parent_cocoa_window ()
return -1;
}
[win setAutodisplay:YES]; // turn of GTK stuff for this window
[win setAutodisplay:1]; // turn of GTK stuff for this window
Gtk::Container* toplevel = get_toplevel();
@ -620,7 +661,9 @@ AUPluginUI::parent_cocoa_window ()
NSPoint origin = { 0, a.height };
[au_view setFrameOrigin:origin];
[view addSubview:au_view positioned:NSWindowBelow relativeTo:nil];
[view addSubview:au_view positioned:NSWindowBelow relativeTo:nil];
last_au_frame = [au_view frame];
// watch for size changes of the view
@ -633,23 +676,6 @@ AUPluginUI::parent_cocoa_window ()
return 0;
}
static void
dump_view_tree (NSView* view, int depth)
{
NSArray* subviews = [view subviews];
unsigned long cnt = [subviews count];
for (int d = 0; d < depth; d++) {
cerr << '\t';
}
cerr << " view @ " << view << endl;
for (unsigned long i = 0; i < cnt; ++i) {
NSView* subview = [subviews objectAtIndex:i];
dump_view_tree (subview, depth+1);
}
}
void
AUPluginUI::forward_key_event (GdkEventKey* ev)
{
@ -681,7 +707,7 @@ AUPluginUI::on_realize ()
NSWindow* win = get_nswindow ();
if (win) {
[win setShowsResizeIndicator:NO];
[win setShowsResizeIndicator:0];
}
}
@ -695,12 +721,6 @@ AUPluginUI::lower_box_realized ()
}
}
bool
AUPluginUI::on_map_event (GdkEventAny*)
{
return false;
}
void
AUPluginUI::on_window_hide ()
{
@ -710,8 +730,14 @@ AUPluginUI::on_window_hide ()
ActivateWindow (carbon_window, FALSE);
}
#endif
hide_all ();
#if 0
NSArray* wins = [NSApp windows];
for (uint32_t i = 0; i < [wins count]; i++) {
id win = [wins objectAtIndex:i];
}
#endif
}
bool
@ -753,19 +779,4 @@ create_au_gui (boost::shared_ptr<PluginInsert> plugin_insert, VBox** box)
return aup;
}
bool
AUPluginUI::on_focus_in_event (GdkEventFocus*)
{
//cerr << "au plugin focus in\n";
//Keyboard::magic_widget_grab_focus ();
return false;
}
bool
AUPluginUI::on_focus_out_event (GdkEventFocus*)
{
//cerr << "au plugin focus out\n";
//Keyboard::magic_widget_drop_focus ();
return false;
}

View file

@ -1540,7 +1540,6 @@ AudioRegionView::show_region_editor ()
}
editor->present ();
editor->set_position (Gtk::WIN_POS_MOUSE);
editor->show_all();
}

View file

@ -21,6 +21,13 @@
#ifndef __ardour_gtk_automation_controller_h__
#define __ardour_gtk_automation_controller_h__
#ifdef YES
#undef YES
#endif
#ifdef NO
#undef NO
#endif
#include <boost/shared_ptr.hpp>
#include <gtkmm.h>

View file

@ -115,7 +115,6 @@ BundleEditorMatrix::add_channel (boost::shared_ptr<Bundle> b, DataType t)
if (b == _bundle) {
NameChannelDialog d;
d.set_position (Gtk::WIN_POS_MOUSE);
if (d.run () != Gtk::RESPONSE_ACCEPT) {
return;
@ -162,7 +161,6 @@ void
BundleEditorMatrix::rename_channel (BundleChannel bc)
{
NameChannelDialog d (bc.bundle, bc.channel);
d.set_position (Gtk::WIN_POS_MOUSE);
if (d.run () != Gtk::RESPONSE_ACCEPT) {
return;

View file

@ -105,7 +105,6 @@ CrossfadeEditor::CrossfadeEditor (Session* s, boost::shared_ptr<Crossfade> xf, d
set_wmclass (X_("ardour_automationedit"), PROGRAM_NAME);
set_name ("CrossfadeEditWindow");
set_position (Gtk::WIN_POS_MOUSE);
add_accel_group (ActionManager::ui_manager->get_accel_group());

View file

@ -146,16 +146,13 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, set<NoteBase*> n)
add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_ACCEPT);
set_default_response (Gtk::RESPONSE_ACCEPT);
show_all ();
}
int
EditNoteDialog::run ()
void
EditNoteDialog::done (int r)
{
int const r = Dialog::run ();
if (r != RESPONSE_ACCEPT) {
return r;
return;
}
/* These calls mean that if a value is entered using the keyboard
@ -227,6 +224,4 @@ EditNoteDialog::run ()
for (set<NoteBase*>::iterator i = _events.begin(); i != _events.end(); ++i) {
(*i)->set_selected ((*i)->selected()); // change color
}
return r;
}

View file

@ -28,11 +28,11 @@ class NoteBase;
class EditNoteDialog : public ArdourDialog
{
public:
EditNoteDialog (MidiRegionView *, std::set<NoteBase*>);
EditNoteDialog (MidiRegionView* rv, set<NoteBase*> n);
int run ();
private:
void done (int);
private:
MidiRegionView* _region_view;
std::set<NoteBase*> _events;
Gtk::SpinButton _channel;

View file

@ -119,10 +119,6 @@
#include "i18n.h"
#ifdef WITH_CMT
#include "imageframe_socket_handler.h"
#endif
using namespace std;
using namespace ARDOUR;
using namespace PBD;
@ -270,10 +266,6 @@ Editor::Editor ()
, _toolbar_viewport (*manage (new Gtk::Adjustment (0, 0, 1e10)), *manage (new Gtk::Adjustment (0, 0, 1e10)))
#ifdef WITH_CMT
, image_socket_listener(0)
#endif
/* nudge */
, nudge_clock (new AudioClock (X_("nudge"), false, X_("nudge"), true, false, true))
@ -768,18 +760,6 @@ Editor::Editor ()
Editor::~Editor()
{
#ifdef WITH_CMT
if(image_socket_listener) {
if(image_socket_listener->is_connected())
{
image_socket_listener->close_connection() ;
}
delete image_socket_listener ;
image_socket_listener = 0 ;
}
#endif
delete button_bindings;
delete _routes;
delete _route_groups;
@ -3333,8 +3313,6 @@ Editor::duplicate_range (bool with_dialog)
win.add_button (_("Duplicate"), RESPONSE_ACCEPT);
win.set_default_response (RESPONSE_ACCEPT);
win.set_position (WIN_POS_MOUSE);
spinner.grab_focus ();
switch (win.run ()) {
@ -5417,7 +5395,6 @@ Editor::change_region_layering_order (bool from_context_menu)
if (layering_order_editor == 0) {
layering_order_editor = new RegionLayeringOrderEditor (*this);
layering_order_editor->set_position (WIN_POS_MOUSE);
}
layering_order_editor->set_context (clicked_routeview->name(), _session, clicked_routeview, pl, position);

View file

@ -97,14 +97,25 @@ class BundleManager;
class ButtonJoiner;
class ControlPoint;
class DragManager;
class EditNoteDialog;
class EditorCursor;
class EditorGroupTabs;
class EditorLocations;
class EditorRegions;
class EditorRoutes;
class EditorRouteGroups;
class EditorSnapshots;
class EditorSummary;
class GroupedButtons;
class GUIObjectState;
class Marker;
class MidiRegionView;
class MixerStrip;
class MouseCursors;
class NoteBase;
class PlaylistSelector;
class PluginSelector;
class ProgressReporter;
class RhythmFerret;
class Selection;
class SoundFileOmega;
@ -113,29 +124,9 @@ class TempoLines;
class TimeAxisView;
class TimeFXDialog;
class TimeSelection;
class EditorGroupTabs;
class EditorRoutes;
class EditorRouteGroups;
class EditorRegions;
class EditorLocations;
class EditorSnapshots;
class EditorSummary;
class RegionLayeringOrderEditor;
class ProgressReporter;
class EditorCursor;
class MouseCursors;
class VerboseCursor;
/* <CMT Additions> */
class ImageFrameView;
class ImageFrameTimeAxisView;
class ImageFrameTimeAxis;
class MarkerTimeAxis ;
class MarkerView ;
class ImageFrameSocketHandler ;
class TimeAxisViewItem ;
/* </CMT Additions> */
class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public Gtkmm2ext::VisibilityTracker
{
public:
@ -1506,7 +1497,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void edit_tempo_marker (ArdourCanvas::Item*);
void edit_meter_marker (ArdourCanvas::Item*);
void edit_control_point (ArdourCanvas::Item*);
void edit_notes (std::set<NoteBase*> const & s);
void edit_notes (TimeAxisViewItem&);
void marker_menu_edit ();
void marker_menu_remove ();
@ -2110,7 +2101,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
bool _following_mixer_selection;
int time_fx (ARDOUR::RegionList&, float val, bool pitching);
void note_edit_done (int, EditNoteDialog*);
void toggle_sound_midi_notes ();
/** Flag for a bit of a hack wrt control point selection; see set_selected_control_point_from_click */

View file

@ -79,10 +79,10 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
temporal_zoom_step (false);
zoom_focus = temp_focus;
return true;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
direction = GDK_SCROLL_LEFT;
goto retry;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
if (!current_stepping_trackview) {
step_timeout = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Editor::track_height_step_timeout), 500);
std::pair<TimeAxisView*, int> const p = trackview_by_y_position (event_coords.y);
@ -108,10 +108,10 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
temporal_zoom_step (true);
zoom_focus = temp_focus;
return true;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
direction = GDK_SCROLL_RIGHT;
goto retry;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
if (!current_stepping_trackview) {
step_timeout = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Editor::track_height_step_timeout), 500);
std::pair<TimeAxisView*, int> const p = trackview_by_y_position (event_coords.y);

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,6 @@
*/
#include <sigc++/retype.h>
#include <cstdlib>
#include <cmath>

View file

@ -1001,10 +1001,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
}
if (internal_editing ()) {
if (event->type == GDK_2BUTTON_PRESS && event->button.button == 1) {
Glib::RefPtr<Action> act = ActionManager::get_action (X_("MouseMode"), X_("toggle-internal-edit"));
act->activate ();
}
break;
}
@ -1140,31 +1136,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
break;
}
#ifdef WITH_CMT
case ImageFrameHandleStartItem:
imageframe_start_handle_op(item, event) ;
return(true) ;
break ;
case ImageFrameHandleEndItem:
imageframe_end_handle_op(item, event) ;
return(true) ;
break ;
case MarkerViewHandleStartItem:
markerview_item_start_handle_op(item, event) ;
return(true) ;
break ;
case MarkerViewHandleEndItem:
markerview_item_end_handle_op(item, event) ;
return(true) ;
break ;
case MarkerViewItem:
start_markerview_grab(item, event) ;
break ;
case ImageFrameItem:
start_imageframe_grab(item, event) ;
break ;
#endif
case MarkerBarItem:
break;
@ -1510,14 +1481,6 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
edit_control_point (item);
break;
case NoteItem:
{
NoteBase* e = reinterpret_cast<NoteBase*> (item->get_data ("notebase"));
assert (e);
edit_notes (e->region_view().selection ());
break;
}
default:
break;
}
@ -1601,21 +1564,6 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
popup_control_point_context_menu (item, event);
break;
#ifdef WITH_CMT
case ImageFrameItem:
popup_imageframe_edit_menu(1, event->button.time, item, true) ;
break ;
case ImageFrameTimeAxisItem:
popup_imageframe_edit_menu(1, event->button.time, item, false) ;
break ;
case MarkerViewItem:
popup_marker_time_axis_edit_menu(1, event->button.time, item, true) ;
break ;
case MarkerTimeAxisItem:
popup_marker_time_axis_edit_menu(1, event->button.time, item, false) ;
break ;
#endif
default:
break;
}
@ -1895,19 +1843,11 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
break;
case StartSelectionTrimItem:
#ifdef WITH_CMT
case ImageFrameHandleStartItem:
case MarkerViewHandleStartItem:
#endif
if (is_drawable()) {
set_canvas_cursor (_cursors->left_side_trim);
}
break;
case EndSelectionTrimItem:
#ifdef WITH_CMT
case ImageFrameHandleEndItem:
case MarkerViewHandleEndItem:
#endif
if (is_drawable()) {
set_canvas_cursor (_cursors->right_side_trim);
}
@ -2082,13 +2022,6 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type)
case EndSelectionTrimItem:
case PlayheadCursorItem:
#ifdef WITH_CMT
case ImageFrameHandleStartItem:
case ImageFrameHandleEndItem:
case MarkerViewHandleStartItem:
case MarkerViewHandleEndItem:
#endif
_over_region_trim_target = false;
if (is_drawable()) {
@ -2376,7 +2309,6 @@ Editor::edit_control_point (ArdourCanvas::Item* item)
}
ControlPointDialog d (p);
d.set_position (Gtk::WIN_POS_MOUSE);
ensure_float (d);
if (d.run () != RESPONSE_ACCEPT) {
@ -2387,19 +2319,33 @@ Editor::edit_control_point (ArdourCanvas::Item* item)
}
void
Editor::edit_notes (MidiRegionView::Selection const & s)
Editor::edit_notes (TimeAxisViewItem& tavi)
{
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(&tavi);
if (!mrv) {
return;
}
MidiRegionView::Selection const & s = mrv->selection();
if (s.empty ()) {
return;
}
EditNoteDialog d (&(*s.begin())->region_view(), s);
d.set_position (Gtk::WIN_POS_MOUSE);
ensure_float (d);
EditNoteDialog* d = new EditNoteDialog (&(*s.begin())->region_view(), s);
d->show_all ();
ensure_float (*d);
d.run ();
d->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &Editor::note_edit_done), d));
}
void
Editor::note_edit_done (int r, EditNoteDialog* d)
{
d->done (r);
delete d;
}
void
Editor::visible_order_range (int* low, int* high) const

View file

@ -2377,7 +2377,6 @@ Editor::rename_region ()
d.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
d.set_size_request (300, -1);
d.set_position (Gtk::WIN_POS_MOUSE);
entry.set_text (rs.front()->region()->name());
entry.select_region (0, -1);

View file

@ -192,7 +192,6 @@ Editor::mouse_add_new_tempo_event (framepos_t frame)
TempoMap& map(_session->tempo_map());
TempoDialog tempo_dialog (map, frame, _("add"));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
//this causes compiz to display no border.
//tempo_dialog.signal_realize().connect (sigc::bind (sigc::ptr_fun (set_decoration), &tempo_dialog, Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
@ -235,8 +234,6 @@ Editor::mouse_add_new_meter_event (framepos_t frame)
TempoMap& map(_session->tempo_map());
MeterDialog meter_dialog (map, frame, _("add"));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
//this causes compiz to display no border..
//meter_dialog.signal_realize().connect (sigc::bind (sigc::ptr_fun (set_decoration), &meter_dialog, Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
@ -292,8 +289,6 @@ Editor::edit_meter_section (MeterSection* section)
{
MeterDialog meter_dialog (*section, _("done"));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
ensure_float (meter_dialog);
switch (meter_dialog.run()) {
@ -324,8 +319,6 @@ Editor::edit_tempo_section (TempoSection* section)
{
TempoDialog tempo_dialog (*section, _("done"));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
ensure_float (tempo_dialog);
switch (tempo_dialog.run ()) {

View file

@ -91,7 +91,6 @@ ExportVideoDialog::ExportVideoDialog (PublicEditor& ed, Session* s)
set_session (s);
set_name ("ExportVideoDialog");
set_position (Gtk::WIN_POS_MOUSE);
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (false);

View file

@ -33,7 +33,6 @@ ExportVideoInfobox::ExportVideoInfobox (Session* s)
set_session (s);
set_name ("ExportVideoInfobox");
set_position (Gtk::WIN_POS_MOUSE);
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (false);

View file

@ -224,8 +224,6 @@ IOSelectorWindow::IOSelectorWindow (ARDOUR::Session* session, boost::shared_ptr<
add (_selector);
set_position (Gtk::WIN_POS_MOUSE);
io_name_changed (this);
show_all ();

View file

@ -42,7 +42,6 @@ MidiPortDialog::MidiPortDialog ()
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (false);
set_position (Gtk::WIN_POS_MOUSE);
set_name (N_("MidiPortDialog"));
vector<string> str = internationalize (PACKAGE, mode_strings);

View file

@ -3755,8 +3755,6 @@ MidiRegionView::edit_patch_change (PatchChange* pc)
{
PatchChangeDialog d (&_source_relative_time_converter, trackview.session(), *pc->patch (), instrument_info(), Gtk::Stock::APPLY, true);
d.set_position (Gtk::WIN_POS_MOUSE);
int response = d.run();
switch (response) {

View file

@ -515,7 +515,6 @@ MidiTimeAxisView::toggle_channel_selector ()
_channel_selector->set_default_channel_color ();
}
_channel_selector->set_position (WIN_POS_MOUSE);
_channel_selector->show_all ();
} else {
_channel_selector->cycle_visibility ();

View file

@ -1358,7 +1358,6 @@ void
MixerStrip::setup_comment_editor ()
{
comment_window = new ArdourWindow (""); // title will be reset to show route
comment_window->set_position (Gtk::WIN_POS_MOUSE);
comment_window->set_skip_taskbar_hint (true);
comment_window->signal_hide().connect (sigc::mem_fun(*this, &MixerStrip::comment_editor_done_editing));
comment_window->set_default_size (400, 200);

View file

@ -342,7 +342,7 @@ NoteBase::event_handler (GdkEvent* ev)
case GDK_BUTTON_PRESS:
set_mouse_fractions (ev);
if (ev->button.button == 3 && Keyboard::no_modifiers_active (ev->button.state) && _selected) {
show_channel_selector();
_region.get_time_axis_view().editor().edit_notes (_region);
return true;
}
break;

View file

@ -44,7 +44,6 @@ PlaylistSelector::PlaylistSelector ()
{
rui = 0;
set_position (WIN_POS_MOUSE);
set_name ("PlaylistSelectorWindow");
set_modal(true);
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);

View file

@ -66,7 +66,6 @@ PluginSelector::PluginSelector (PluginManager& mgr)
, manager (mgr)
{
set_position (Gtk::WIN_POS_MOUSE);
set_name ("PluginSelectorWindow");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);

View file

@ -82,11 +82,10 @@ using namespace Gtkmm2ext;
using namespace Gtk;
PluginUIWindow::PluginUIWindow (
Gtk::Window* win,
boost::shared_ptr<PluginInsert> insert,
bool scrollable,
bool editor)
: parent (win)
: ArdourWindow (string())
, was_visible (false)
, _keyboard_focused (false)
#ifdef AUDIOUNIT_SUPPORT
@ -96,7 +95,6 @@ PluginUIWindow::PluginUIWindow (
{
bool have_gui = false;
Label* label = manage (new Label());
label->set_markup ("<b>THIS IS THE PLUGIN UI</b>");
@ -147,7 +145,6 @@ PluginUIWindow::PluginUIWindow (
signal_unmap_event().connect (sigc::mem_fun (*pu, &GenericPluginUI::stop_updating));
}
// set_position (Gtk::WIN_POS_MOUSE);
set_name ("PluginEditor");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
@ -170,19 +167,10 @@ PluginUIWindow::~PluginUIWindow ()
delete _pluginui;
}
void
PluginUIWindow::set_parent (Gtk::Window* win)
{
parent = win;
}
void
PluginUIWindow::on_map ()
{
Window::on_map ();
#ifdef __APPLE__
set_keep_above (true);
#endif // __APPLE__
}
bool
@ -226,19 +214,25 @@ PluginUIWindow::on_show ()
}
if (_pluginui) {
#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX)
if (pre_deactivate_x >= 0) {
move (pre_deactivate_x, pre_deactivate_y);
}
#endif
if (_pluginui->on_window_show (_title)) {
Window::on_show ();
}
}
if (parent) {
// set_transient_for (*parent);
}
}
void
PluginUIWindow::on_hide ()
{
#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX)
get_position (pre_deactivate_x, pre_deactivate_y);
#endif
Window::on_hide ();
if (_pluginui) {
@ -560,7 +554,6 @@ PlugUIBase::latency_button_clicked ()
if (!latency_gui) {
latency_gui = new LatencyGUI (*(insert.get()), insert->session().frame_rate(), insert->session().get_block_size());
latency_dialog = new ArdourWindow (_("Edit Latency"));
latency_dialog->set_position (WIN_POS_MOUSE);
/* use both keep-above and transient for to try cover as many
different WM's as possible.
*/

View file

@ -50,6 +50,7 @@
#include "automation_controller.h"
#include "ardour_button.h"
#include "ardour_window.h"
namespace ARDOUR {
class PluginInsert;
@ -278,11 +279,10 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *);
};
class PluginUIWindow : public Gtk::Window
class PluginUIWindow : public ArdourWindow
{
public:
PluginUIWindow (Gtk::Window*,
boost::shared_ptr<ARDOUR::PluginInsert> insert,
PluginUIWindow (boost::shared_ptr<ARDOUR::PluginInsert> insert,
bool scrollable=false,
bool editor=true);
~PluginUIWindow ();

View file

@ -1183,7 +1183,6 @@ ProcessorBox::weird_plugin_dialog (Plugin& p, Route::ProcessorStreams streams)
dialog.add_button (Stock::OK, RESPONSE_ACCEPT);
dialog.set_name (X_("PluginIODialog"));
dialog.set_position (Gtk::WIN_POS_MOUSE);
dialog.set_modal (true);
dialog.show_all ();
@ -1550,7 +1549,6 @@ outputs will not work correctly."));
dialog.add_button (Stock::OK, RESPONSE_ACCEPT);
dialog.set_name (X_("PluginIODialog"));
dialog.set_position (Gtk::WIN_POS_MOUSE);
dialog.set_modal (true);
dialog.show_all ();
@ -2094,20 +2092,16 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
/* these are both allowed to be null */
Container* toplevel = get_toplevel();
Window* win = dynamic_cast<Gtk::Window*>(toplevel);
Window* w = get_processor_ui (plugin_insert);
if (w == 0) {
plugin_ui = new PluginUIWindow (win, plugin_insert);
plugin_ui = new PluginUIWindow (plugin_insert);
plugin_ui->set_title (generate_processor_title (plugin_insert));
set_processor_ui (plugin_insert, plugin_ui);
} else {
plugin_ui = dynamic_cast<PluginUIWindow *> (w);
plugin_ui->set_parent (win);
}
gidget = plugin_ui;
@ -2155,9 +2149,7 @@ ProcessorBox::toggle_edit_generic_processor (boost::shared_ptr<Processor> proces
return;
}
Container* toplevel = get_toplevel();
Window* win = dynamic_cast<Gtk::Window*>(toplevel);
PluginUIWindow* plugin_ui = new PluginUIWindow(win, plugin_insert, true, false);
PluginUIWindow* plugin_ui = new PluginUIWindow (plugin_insert, true, false);
plugin_ui->set_title(generate_processor_title (plugin_insert));
if (plugin_ui->is_visible()) {

View file

@ -288,6 +288,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
virtual void add_to_idle_resize (TimeAxisView*, int32_t) = 0;
virtual framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next) = 0;
virtual Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position) = 0;
virtual void edit_notes (TimeAxisViewItem&) = 0;
virtual void queue_visual_videotimeline_update () = 0;
virtual void toggle_ruler_video (bool) = 0;
@ -299,14 +300,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
virtual void embed_audio_from_video (std::string, framepos_t n = 0) = 0;
virtual void export_video () = 0;
#ifdef WITH_CMT
virtual void connect_to_image_compositor() = 0;
virtual void add_imageframe_time_axis(const std::string & track_name, void*) = 0;
virtual void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) = 0;
virtual void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) = 0;
virtual TimeAxisView* get_named_time_axis(const std::string & name) = 0;
#endif
virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0;
virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, PBD::PropertyID) const = 0;

View file

@ -50,7 +50,6 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new)
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (true);
set_position (Gtk::WIN_POS_MOUSE);
set_name (N_("RouteGroupDialog"));
VBox* main_vbox = manage (new VBox);

View file

@ -25,6 +25,10 @@
#include "ardour/ardour.h"
#include "ardour/filesystem_paths.h"
#ifdef check
#undef check
#endif
#include "gui_thread.h"
#include "splash.h"
@ -96,15 +100,33 @@ Splash::~Splash ()
void
Splash::pop_back_for (Gtk::Window& win)
{
#ifdef __APPLE__
/* April 2013: window layering on OS X is a bit different to X Window. at present,
the "restack()" functionality in GDK will only operate on windows in the same
"level" (e.g. two normal top level windows, or two utility windows) and will not
work across them. The splashscreen is on its own "StatusWindowLevel" so restacking
is not going to work.
So for OS X, we just hide ourselves.
*/
hide();
#else
set_keep_above (false);
get_window()->restack (win.get_window(), false);
win.signal_hide().connect (sigc::mem_fun (*this, &Splash::pop_front));
#endif
}
void
Splash::pop_front ()
{
#ifdef __APPLE__
if (get_window()) {
show ();
}
#else
set_keep_above (true);
#endif
}
void

View file

@ -82,7 +82,6 @@ StepEditor::start_step_editing ()
step_edit_region_view->show_step_edit_cursor (step_edit_beat_pos);
step_edit_region_view->set_step_edit_cursor_width (step_editor->note_length());
step_editor->set_position (WIN_POS_MOUSE);
step_editor->present ();
}

View file

@ -38,6 +38,8 @@
using namespace std;
void * interposer_thread (void *arg);
static void close_fd (int* fd) { if (!fd) return; if (*fd >= 0) ::close (*fd); *fd = -1; }
SystemExec::SystemExec (std::string c, std::string a)
: cmd(c)
{
@ -483,18 +485,18 @@ SystemExec::start (int stderr_mode)
pid=r;
/* check if execve was successful. */
::close(pok[1]);
close_fd(&pok[1]);
char buf;
for ( ;; ) {
ssize_t n = ::read(pok[0], &buf, 1 );
if ( n==1 ) {
/* child process returned from execve */
pid=0;
::close(pok[0]);
::close(pin[1]);
::close(pin[0]);
::close(pout[1]);
::close(pout[0]);
close_fd(&pok[0]);
close_fd(&pin[1]);
close_fd(&pin[0]);
close_fd(&pout[1]);
close_fd(&pout[0]);
pin[1] = -1;
return -3;
} else if ( n==-1 ) {
@ -503,7 +505,7 @@ SystemExec::start (int stderr_mode)
}
break;
}
::close(pok[0]);
close_fd(&pok[0]);
/* child started successfully */
#if 0
@ -519,17 +521,17 @@ SystemExec::start (int stderr_mode)
}
if (r == 0) {
/* 2nd child process - catch stdout */
::close(pin[1]);
::close(pout[1]);
close_fd(&pin[1]);
close_fd(&pout[1]);
output_interposer();
exit(0);
}
::close(pout[1]);
::close(pin[0]);
::close(pout[0]);
close_fd(&pout[1]);
close_fd(&pin[0]);
close_fd(&pout[0]);
#else /* use pthread */
::close(pout[1]);
::close(pin[0]);
close_fd(&pout[1]);
close_fd(&pin[0]);
int rv = pthread_create(&thread_id_tt, NULL, interposer_thread, this);
thread_active=true;
@ -543,15 +545,15 @@ SystemExec::start (int stderr_mode)
}
/* child process - exec external process */
::close(pok[0]);
close_fd(&pok[0]);
::fcntl(pok[1], F_SETFD, FD_CLOEXEC);
::close(pin[1]);
close_fd(&pin[1]);
if (pin[0] != STDIN_FILENO) {
::dup2(pin[0], STDIN_FILENO);
}
::close(pin[0]);
::close(pout[0]);
close_fd(&pin[0]);
close_fd(&pout[0]);
if (pout[1] != STDOUT_FILENO) {
::dup2(pout[1], STDOUT_FILENO);
}
@ -569,7 +571,7 @@ SystemExec::start (int stderr_mode)
}
if (pout[1] != STDOUT_FILENO && pout[1] != STDERR_FILENO) {
::close(pout[1]);
close_fd(&pout[1]);
}
if (nicelevel !=0) {
@ -596,7 +598,7 @@ SystemExec::start (int stderr_mode)
/* if we reach here something went wrong.. */
char buf = 0;
(void) ::write(pok[1], &buf, 1 );
(void) ::close(pok[1]);
close_fd(&pok[1]);
exit(-1);
return -1;
}
@ -631,11 +633,10 @@ void
SystemExec::close_stdin()
{
if (pin[1]<0) return;
::close(pin[0]);
::close(pin[1]);
::close(pout[0]);
::close(pout[1]);
pin[1] = - 1; // mark as closed
close_fd(&pin[0]);
close_fd(&pin[1]);
close_fd(&pout[0]);
close_fd(&pout[1]);
}
int

View file

@ -68,7 +68,6 @@ TimeFXDialog::TimeFXDialog (Editor& e, bool pitch)
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (false);
set_position (Gtk::WIN_POS_MOUSE);
set_name (N_("TimeFXDialog"));
if (pitching) {

View file

@ -77,7 +77,6 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
aborted = false;
set_name ("TranscodeVideoDialog");
set_position (Gtk::WIN_POS_MOUSE);
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (false);

View file

@ -53,7 +53,6 @@ VideoServerDialog::VideoServerDialog (Session* s)
set_session (s);
set_name ("VideoServerDialog");
set_position (Gtk::WIN_POS_MOUSE);
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (false);

View file

@ -73,7 +73,6 @@ public:
AEffect * plugin () const { return _plugin; }
VSTState * state () const { return _state; }
void set_state (VSTState* s) { _state = s; }
int set_state (XMLNode const &, int);

View file

@ -1299,8 +1299,8 @@ AUPlugin::render_callback(AudioUnitRenderActionFlags*,
{
/* not much to do with audio - the data is already in the buffers given to us in connect_and_run() */
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1: render callback, frames %2 bufs %3\n",
name(), inNumberFrames, ioData->mNumberBuffers));
// DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1: render callback, frames %2 bufs %3\n",
// name(), inNumberFrames, ioData->mNumberBuffers));
if (input_maxbuf == 0) {
error << _("AUPlugin: render callback called illegally!") << endmsg;

View file

@ -34,8 +34,6 @@
#include <glibmm/fileutils.h>
#include "ardour/linux_vst_support.h"
#include "ardour/vst_plugin.h"
#include "pbd/basename.h"
#include "pbd/error.h"
@ -295,43 +293,36 @@ vstfx_unload (VSTHandle* fhandle)
return 0;
}
/**
Instantiates a VST plugin and also set _state of its plugin argument
*/
/*This instantiates a plugin*/
VSTState*
vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void *ptr)
VSTState *
vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr)
{
VSTState* vstfx = vstfx_new ();
ARDOUR::VSTPlugin* plugin = reinterpret_cast<ARDOUR::VSTPlugin*> (ptr);
if (fhandle == 0) {
if(fhandle == 0)
{
vstfx_error( "** ERROR ** VSTFX : The handle was 0\n" );
return 0;
}
if ((vstfx->plugin = fhandle->main_entry (amc)) == 0) {
if ((vstfx->plugin = fhandle->main_entry (amc)) == 0)
{
vstfx_error ("** ERROR ** VSTFX : %s could not be instantiated :(\n", fhandle->name);
free (vstfx);
return 0;
}
vstfx->handle = fhandle;
vstfx->plugin->user = plugin;
vstfx->plugin->user = userptr;
if (vstfx->plugin->magic != kEffectMagic) {
if (vstfx->plugin->magic != kEffectMagic)
{
vstfx_error ("** ERROR ** VSTFX : %s is not a VST plugin\n", fhandle->name);
free (vstfx);
return 0;
}
/* need to set this here because some plugins make audioMaster
* callbacks from within effOpen, and _state must be set for
* that to work.
*/
plugin->set_state (vstfx);
vstfx->plugin->dispatcher (vstfx->plugin, effOpen, 0, 0, 0, 0);
/*May or May not need to 'switch the plugin on' here - unlikely

View file

@ -32,7 +32,7 @@ LXVSTPlugin::LXVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h)
{
/* Instantiate the plugin and return a VSTState* */
if (vstfx_instantiate (_handle, Session::vst_callback, this) == 0) {
if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor();
}
@ -44,7 +44,7 @@ LXVSTPlugin::LXVSTPlugin (const LXVSTPlugin &other)
{
_handle = other._handle;
if (vstfx_instantiate (_handle, Session::vst_callback, this) == 0) {
if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor();
}
_plugin = _state->plugin;

View file

@ -1,158 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Session version="3001" name="rec_enabled" sample-rate="48000" id-counter="121" event-counter="0">
<Config>
<Option name="xfade-model" value="FullCrossfade"/>
<Option name="xfade-choice" value="ConstantPowerMinus3dB"/>
<Option name="auto-xfade" value="1"/>
<Option name="short-xfade-seconds" value="0.015"/>
<Option name="destructive-xfade-msecs" value="2"/>
<Option name="use-region-fades" value="1"/>
<Option name="show-region-fades" value="1"/>
<Option name="native-file-data-format" value="FormatFloat"/>
<Option name="native-file-header-format" value="WAVE"/>
<Option name="auto-play" value="0"/>
<Option name="auto-return" value="0"/>
<Option name="auto-input" value="1"/>
<Option name="punch-in" value="0"/>
<Option name="punch-out" value="0"/>
<Option name="subframes-per-frame" value="100"/>
<Option name="timecode-format" value="timecode_30"/>
<Option name="raid-path" value=""/>
<Option name="audio-search-path" value=""/>
<Option name="midi-search-path" value=""/>
<Option name="auditioner-output-left" value="default"/>
<Option name="auditioner-output-right" value="default"/>
<Option name="timecode-source-is-synced" value="1"/>
<Option name="jack-time-master" value="1"/>
<Option name="use-video-sync" value="0"/>
<Option name="video-pullup" value="0"/>
<Option name="show-summary" value="1"/>
<Option name="show-group-tabs" value="1"/>
<Option name="external-sync" value="0"/>
<Option name="sync-source" value="JACK"/>
<Option name="insert-merge-policy" value="InsertMergeRelax"/>
<Option name="timecode-offset" value="0"/>
<Option name="timecode-offset-negative" value="1"/>
<Option name="glue-new-markers-to-bars-and-beats" value="0"/>
<Option name="midi-copy-is-fork" value="0"/>
<Option name="glue-new-regions-to-bars-and-beats" value="0"/>
</Config>
<Metadata/>
<Sources/>
<Regions/>
<Locations>
<Location id="86" name="Loop" start="0" end="1" flags="IsAutoLoop,IsHidden" locked="no" position-lock-style="AudioTime"/>
<Location id="87" name="Punch" start="0" end="1" flags="IsAutoPunch,IsHidden" locked="no" position-lock-style="AudioTime"/>
</Locations>
<Bundles/>
<Routes>
<Route id="88" name="Audio 1" default-type="audio" active="yes" phase-invert="0" denormal-protection="no" meter-point="MeterPostFader" order-keys="" self-solo="no" soloed-by-upstream="0" soloed-by-downstream="0" solo-isolated="no" solo-safe="no" monitoring="" saved-meter-point="MeterPostFader" mode="Normal">
<IO name="Audio 1" id="105" direction="Input" default-type="audio" user-latency="0">
<Port type="audio" name="Audio 1/audio_in 1">
<Connection other="system:capture_1"/>
</Port>
</IO>
<IO name="Audio 1" id="106" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="Audio 1/audio_out 1">
<Connection other="master/audio_in 1"/>
</Port>
<Port type="audio" name="Audio 1/audio_out 2">
<Connection other="master/audio_in 2"/>
</Port>
</IO>
<Controllable name="solo" id="90" flags="Toggle" value="0.000000000000"/>
<Controllable name="mute" id="92" flags="Toggle" value="0.000000000000"/>
<MuteMaster mute-point="PreFader,PostFader,Listen,Main" muted="no"/>
<Pannable>
<Controllable name="pan-azimuth" id="96" flags="" value="0.500000000000"/>
<Controllable name="pan-width" id="100" flags="" value="0.000000000000"/>
<Controllable name="pan-elevation" id="98" flags="" value="0.000000000000"/>
<Controllable name="pan-frontback" id="102" flags="" value="0.000000000000"/>
<Controllable name="pan-lfe" id="104" flags="" value="0.000000000000"/>
<Automation/>
</Pannable>
<Processor id="107" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="109" flags="GainLike" value="1.000000000000"/>
</Processor>
<Processor id="110" name="Meter" active="yes" user-latency="0" type="meter"/>
<Processor id="111" name="Audio 1" active="yes" user-latency="0" own-input="yes" own-output="no" output="Audio 1" type="main-outs" role="Main">
<PannerShell bypassed="no">
<Panner type="Mono to Stereo Panner"/>
</PannerShell>
</Processor>
<Controllable name="recenable" id="113" flags="Toggle" value="0.000000000000"/>
<Diskstream flags="Recordable" playlist="Audio 1.1" name="Audio 1" id="115" speed="1.000000" capture-alignment="Automatic" channels="1"/>
</Route>
<Route id="21" name="master" default-type="audio" flags="MasterOut" active="yes" phase-invert="00" denormal-protection="no" meter-point="MeterPostFader" order-keys="EditorSort=318:MixerSort=318" self-solo="no" soloed-by-upstream="0" soloed-by-downstream="0" solo-isolated="no" solo-safe="no">
<IO name="master" id="38" direction="Input" default-type="audio" user-latency="0">
<Port type="audio" name="master/audio_in 1">
<Connection other="Audio 1/audio_out 1"/>
</Port>
<Port type="audio" name="master/audio_in 2">
<Connection other="Audio 1/audio_out 2"/>
</Port>
</IO>
<IO name="master" id="39" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="master/audio_out 1">
<Connection other="system:playback_1"/>
</Port>
<Port type="audio" name="master/audio_out 2">
<Connection other="system:playback_2"/>
</Port>
</IO>
<Controllable name="solo" id="23" flags="Toggle" value="0.000000000000"/>
<Controllable name="mute" id="25" flags="Toggle" value="0.000000000000"/>
<MuteMaster mute-point="PreFader,PostFader,Listen,Main" muted="no"/>
<Pannable>
<Controllable name="pan-azimuth" id="29" flags="" value="0.500000000000"/>
<Controllable name="pan-width" id="33" flags="" value="1.000000000000"/>
<Controllable name="pan-elevation" id="31" flags="" value="0.000000000000"/>
<Controllable name="pan-frontback" id="35" flags="" value="0.000000000000"/>
<Controllable name="pan-lfe" id="37" flags="" value="0.000000000000"/>
<Automation/>
</Pannable>
<Processor id="40" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="42" flags="GainLike" value="1.000000000000"/>
</Processor>
<Processor id="43" name="Meter" active="yes" user-latency="0" type="meter"/>
<Processor id="44" name="master" active="yes" user-latency="0" own-input="yes" own-output="no" output="master" type="main-outs" role="Main">
<PannerShell bypassed="no">
<Panner type="Equal Power Stereo"/>
</PannerShell>
</Processor>
</Route>
</Routes>
<Playlists>
<Playlist id="116" name="Audio 1.1" type="audio" orig-track-id="88" frozen="no" combine-ops="0"/>
</Playlists>
<UnusedPlaylists/>
<RouteGroups/>
<Click>
<IO name="click" id="46" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="click/audio_out 1">
<Connection other="system:playback_1"/>
</Port>
<Port type="audio" name="click/audio_out 2">
<Connection other="system:playback_2"/>
</Port>
</IO>
<Processor id="47" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="49" flags="GainLike" value="1.000000000000"/>
</Processor>
</Click>
<Speakers>
<Speaker azimuth="0" elevation="0" distance="1"/>
<Speaker azimuth="180" elevation="0" distance="0"/>
</Speakers>
<TempoMap>
<Tempo start="1|1|0" beats-per-minute="120.000000" note-type="4.000000" movable="no"/>
<Meter start="1|1|0" note-type="4.000000" divisions-per-bar="4.000000" movable="no"/>
</TempoMap>
<ControlProtocols>
<Protocol name="Open Sound Control (OSC)" active="no"/>
<Protocol name="Generic MIDI" feedback="0" feedback-interval="10000" active="yes">
<Controls/>
</Protocol>
<Protocol name="Mackie" bank="0" ipmidi-base="21928" device-profile="" device-name="Mackie Control Universal Pro" active="yes"/>
</ControlProtocols>
</Session>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<UndoHistory/>

View file

@ -1,148 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Session version="3001" name="1region" sample-rate="48000" id-counter="120" event-counter="0">
<Config>
<Option name="xfade-model" value="FullCrossfade"/>
<Option name="xfade-choice" value="ConstantPowerMinus3dB"/>
<Option name="auto-xfade" value="1"/>
<Option name="short-xfade-seconds" value="0.015"/>
<Option name="destructive-xfade-msecs" value="2"/>
<Option name="use-region-fades" value="1"/>
<Option name="show-region-fades" value="1"/>
<Option name="native-file-data-format" value="FormatFloat"/>
<Option name="native-file-header-format" value="WAVE"/>
<Option name="auto-play" value="0"/>
<Option name="auto-return" value="0"/>
<Option name="auto-input" value="1"/>
<Option name="punch-in" value="0"/>
<Option name="punch-out" value="0"/>
<Option name="subframes-per-frame" value="100"/>
<Option name="timecode-format" value="timecode_30"/>
<Option name="raid-path" value=""/>
<Option name="audio-search-path" value=""/>
<Option name="midi-search-path" value=""/>
<Option name="auditioner-output-left" value="default"/>
<Option name="auditioner-output-right" value="default"/>
<Option name="timecode-source-is-synced" value="1"/>
<Option name="jack-time-master" value="1"/>
<Option name="use-video-sync" value="0"/>
<Option name="video-pullup" value="0"/>
<Option name="show-summary" value="1"/>
<Option name="show-group-tabs" value="1"/>
<Option name="external-sync" value="0"/>
<Option name="sync-source" value="JACK"/>
<Option name="insert-merge-policy" value="InsertMergeRelax"/>
<Option name="timecode-offset" value="0"/>
<Option name="timecode-offset-negative" value="1"/>
<Option name="glue-new-markers-to-bars-and-beats" value="0"/>
<Option name="midi-copy-is-fork" value="0"/>
<Option name="glue-new-regions-to-bars-and-beats" value="0"/>
</Config>
<Metadata/>
<Sources/>
<Regions/>
<Locations>
<Location id="86" name="Loop" start="0" end="1" flags="IsAutoLoop,IsHidden" locked="no" position-lock-style="AudioTime"/>
<Location id="87" name="Punch" start="0" end="1" flags="IsAutoPunch,IsHidden" locked="no" position-lock-style="AudioTime"/>
</Locations>
<Bundles/>
<Routes>
<Route id="21" name="master" default-type="audio" flags="MasterOut" active="yes" phase-invert="00" denormal-protection="no" meter-point="MeterPostFader" order-keys="editor=0:signal=0" self-solo="no" soloed-by-upstream="0" soloed-by-downstream="0" solo-isolated="no" solo-safe="no">
<IO name="master" id="38" direction="Input" default-type="audio" user-latency="0">
<Port type="audio" name="master/audio_in 1"/>
<Port type="audio" name="master/audio_in 2"/>
</IO>
<IO name="master" id="39" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="master/audio_out 1">
<Connection other="system:playback_1"/>
</Port>
<Port type="audio" name="master/audio_out 2">
<Connection other="system:playback_2"/>
</Port>
</IO>
<Controllable name="solo" id="23" flags="Toggle" value="0.000000000000"/>
<Controllable name="mute" id="25" flags="Toggle" value="0.000000000000"/>
<MuteMaster mute-point="PreFader,PostFader,Listen,Main" muted="no"/>
<RemoteControl id="318"/>
<Pannable>
<Controllable name="pan-azimuth" id="29" flags="" value="0.500000000000"/>
<Controllable name="pan-width" id="33" flags="" value="1.000000000000"/>
<Controllable name="pan-elevation" id="31" flags="" value="0.000000000000"/>
<Controllable name="pan-frontback" id="35" flags="" value="0.000000000000"/>
<Controllable name="pan-lfe" id="37" flags="" value="0.000000000000"/>
<Automation/>
</Pannable>
<Processor id="40" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="42" flags="GainLike" value="1.000000000000"/>
</Processor>
<Processor id="43" name="Meter" active="yes" user-latency="0" type="meter"/>
<Processor id="44" name="master" active="yes" user-latency="0" own-input="yes" own-output="no" output="master" type="main-outs" role="Main">
<PannerShell bypassed="no">
<Panner type="Equal Power Stereo"/>
</PannerShell>
</Processor>
</Route>
<Route id="88" name="MIDI 1" default-type="midi" active="yes" phase-invert="" denormal-protection="no" meter-point="MeterPostFader" order-keys="signal=2" self-solo="no" soloed-by-upstream="0" soloed-by-downstream="0" solo-isolated="no" solo-safe="no" monitoring="" saved-meter-point="MeterPostFader" note-mode="Sustained" step-editing="no" input-active="yes">
<IO name="MIDI 1" id="105" direction="Input" default-type="midi" user-latency="0">
<Port type="midi" name="MIDI 1/midi_in 1"/>
</IO>
<IO name="MIDI 1" id="106" direction="Output" default-type="midi" user-latency="0">
<Port type="midi" name="MIDI 1/midi_out 1"/>
</IO>
<Controllable name="solo" id="90" flags="Toggle" value="0.000000000000"/>
<Controllable name="mute" id="92" flags="Toggle" value="0.000000000000"/>
<MuteMaster mute-point="PreFader,PostFader,Listen,Main" muted="no"/>
<RemoteControl id="2"/>
<Pannable>
<Controllable name="pan-azimuth" id="96" flags="" value="0.500000000000"/>
<Controllable name="pan-width" id="100" flags="" value="0.000000000000"/>
<Controllable name="pan-elevation" id="98" flags="" value="0.000000000000"/>
<Controllable name="pan-frontback" id="102" flags="" value="0.000000000000"/>
<Controllable name="pan-lfe" id="104" flags="" value="0.000000000000"/>
<Automation/>
</Pannable>
<Processor id="107" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="109" flags="GainLike" value="1.000000000000"/>
</Processor>
<Processor id="110" name="Meter" active="yes" user-latency="0" type="meter"/>
<Processor id="111" name="MIDI 1" active="yes" user-latency="0" own-input="yes" own-output="no" output="MIDI 1" type="main-outs" role="Main">
<PannerShell bypassed="no"/>
</Processor>
<Controllable name="recenable" id="113" flags="Toggle" value="0.000000000000"/>
<Diskstream flags="Recordable" playlist="MIDI 1.1" name="MIDI 1" id="115" speed="1.000000" capture-alignment="Automatic" channel-mode="AllChannels" channel-mask="0xffff"/>
</Route>
</Routes>
<Playlists>
<Playlist id="116" name="MIDI 1.1" type="midi" orig-track-id="88" frozen="no" combine-ops="0"/>
</Playlists>
<UnusedPlaylists/>
<RouteGroups/>
<Click>
<IO name="click" id="46" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="click/audio_out 1">
<Connection other="system:playback_1"/>
</Port>
<Port type="audio" name="click/audio_out 2">
<Connection other="system:playback_2"/>
</Port>
</IO>
<Processor id="47" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="49" flags="GainLike" value="1.000000000000"/>
</Processor>
</Click>
<NamedSelections/>
<Speakers>
<Speaker azimuth="0" elevation="0" distance="1"/>
<Speaker azimuth="180" elevation="0" distance="0"/>
</Speakers>
<TempoMap>
<Tempo start="1|1|0" beats-per-minute="120.000000" note-type="4.000000" movable="no"/>
<Meter start="1|1|0" note-type="4.000000" divisions-per-bar="4.000000" movable="no"/>
</TempoMap>
<ControlProtocols>
<Protocol name="Open Sound Control (OSC)" active="no"/>
<Protocol name="Generic MIDI" feedback="0" feedback-interval="10000" active="yes">
<Controls/>
</Protocol>
<Protocol name="Mackie" bank="0" ipmidi-base="21928" device-profile="" device-name="Mackie Control Universal Pro" active="yes"/>
</ControlProtocols>
</Session>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<UndoHistory/>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<UndoHistory/>

View file

@ -257,7 +257,6 @@ Sequence<Time>::const_iterator::operator++()
throw std::logic_error("Attempt to iterate past end of Sequence");
}
DEBUG_TRACE(DEBUG::Sequence, "Sequence::const_iterator++\n");
assert(_event && _event->buffer() && _event->size() > 0);
const MIDIEvent<Time>& ev = *((MIDIEvent<Time>*)_event.get());
@ -378,30 +377,30 @@ Sequence<Time>::const_iterator::operator++()
// Set event to reflect new position
switch (_type) {
case NOTE_ON:
DEBUG_TRACE(DEBUG::Sequence, "iterator = note on\n");
// DEBUG_TRACE(DEBUG::Sequence, "iterator = note on\n");
*_event = (*_note_iter)->on_event();
_active_notes.push(*_note_iter);
break;
case NOTE_OFF:
DEBUG_TRACE(DEBUG::Sequence, "iterator = note off\n");
// DEBUG_TRACE(DEBUG::Sequence, "iterator = note off\n");
assert(!_active_notes.empty());
*_event = _active_notes.top()->off_event();
_active_notes.pop();
break;
case CONTROL:
DEBUG_TRACE(DEBUG::Sequence, "iterator = control\n");
//DEBUG_TRACE(DEBUG::Sequence, "iterator = control\n");
_seq->control_to_midi_event(_event, *_control_iter);
break;
case SYSEX:
DEBUG_TRACE(DEBUG::Sequence, "iterator = sysex\n");
//DEBUG_TRACE(DEBUG::Sequence, "iterator = sysex\n");
*_event = *(*_sysex_iter);
break;
case PATCH_CHANGE:
DEBUG_TRACE(DEBUG::Sequence, "iterator = patch change\n");
//DEBUG_TRACE(DEBUG::Sequence, "iterator = patch change\n");
*_event = (*_patch_change_iter)->message (_active_patch_change_message);
break;
default:
DEBUG_TRACE(DEBUG::Sequence, "iterator = end\n");
//DEBUG_TRACE(DEBUG::Sequence, "iterator = end\n");
_is_end = true;
}
@ -1025,12 +1024,12 @@ Sequence<Time>::append_note_off_unlocked (NotePtr note)
_edited = true;
#ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
#ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
if (_percussive) {
DEBUG_TRACE(DEBUG::Sequence, "Sequence Ignoring note off (percussive mode)\n");
return;
}
#endif
#endif
bool resolved = false;
@ -1073,7 +1072,7 @@ template<typename Time>
void
Sequence<Time>::append_control_unlocked(const Parameter& param, Time time, double value, event_id_t /* evid */)
{
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1 %2 @ %3\t=\t%4 # controls: %5\n",
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1 %2 @ %3 = %4 # controls: %5\n",
this, _type_map.to_symbol(param), time, value, _controls.size()));
boost::shared_ptr<Control> c = control(param, true);
c->list()->add (time, value);

View file

@ -1,102 +0,0 @@
/*
* file that facilitates C++ program debugging.
*
* Copyright 1995 by Gray Watson
*
* This file is part of the dmalloc package.
*
* Permission to use, copy, modify, and distribute this software for any
* NON-COMMERCIAL purpose and without fee is hereby granted, provided
* that the above copyright notice and this permission notice appear
* in all copies, and that the name of Gray Watson not be used in
* advertising or publicity pertaining to distribution of the document
* or software without specific, written prior permission.
*
* Please see the PERMISSIONS file or contact the author for information
* about commercial licenses.
*
* Gray Watson makes no representations about the suitability of the
* software described herein for any purpose. It is provided "as is"
* without express or implied warranty.
*
* The author may be contacted via http://www.letters.com/~gray/
*
* $Id$
*/
/*
* This file is used to effectively redirect new to the more familiar
* malloc and delete to the more familiar free so they can be debugged
* with the debug malloc library.. They also give the known error
* behavior, too.
*
* Compile and link this in with the C++ program you want to debug.
*
* NOTE: I am not a C++ hacker so feedback in the form of other hints
* and ideas for C++ users would be much appreciated.
*/
#ifdef DEBUG_MALLOC
extern "C" {
#include <stdlib.h>
#include <dmalloc.h>
#include "/usr/local/src/dmalloc-4.1.2/return.h"
}
/*
* An overload function for the C++ new.
*/
void *
operator new(size_t size)
{
char *file;
GET_RET_ADDR(file);
/* handle correct C++ semantics for an alloc of size 0 */
if (size == 0) size = 1;
return _malloc_leap(file, 0, size);
}
/*
* An overload function for the C++ new[].
*/
void *
operator new[](size_t size)
{
char *file;
GET_RET_ADDR(file);
/* handle correct C++ semantics for an alloc of size 0 */
if (size == 0) size = 1;
return _malloc_leap(file, 0, size);
}
/*
* An overload function for the C++ delete.
*/
void
operator delete(void *pnt)
{
char *file;
GET_RET_ADDR(file);
_free_leap(file, 0, pnt);
}
/*
* An overload function for the C++ delete[]. Thanks to Jens Krinke
* <j.krinke@gmx.de>
*/
void
operator delete[](void *pnt)
{
char *file;
GET_RET_ADDR(file);
_free_leap(file, 0, pnt);
}
#endif

View file

@ -1,6 +1,10 @@
/* Copyright unknown. Code by Laurent de Soras <laurent@ohmforce.com>.
*/
/*
Copyright © 2013 Laurent de Soras <laurent.de.soras@free.fr>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
#ifndef __pbd_fastlog_h__
#define __pbd_fastlog_h__

View file

@ -43,7 +43,6 @@ libpbd_sources = [
'debug.cc',
'enumwriter.cc',
'event_loop.cc',
'dmalloc.cc',
'enums.cc',
'epa.cc',
'error.cc',

View file

@ -1,21 +0,0 @@
This module works with the Griffin Powermate and allows some basic transport control.
It autodetects the Powermate on any input device of the form "/dev/input/event*". This means you must have the powermate module in your kernel. It works out-of-the-box with 64Studio and presumably lots of other modern distributions.
Turning the wheel left and right will act as a "Shuttle" wheel, adjusting playback speed up and down
Pushing the knob will switch between play and stop
Pushing the knob while turning will jump to the next or previous markers
In order for the powermate to work, you have to have permission to open the input device for reading.
In debian, I changed /etc/udev/rules.d/0_permissions.rules to have the line:
KERNEL=="event[0-9]*", MODE="0666"
but there are other ways to achieve this
Feedback, tweaks, bug fixes and feature ideas are encouraged
-Ben Loftis, ben@benloftis.com

View file

@ -1,16 +0,0 @@
#ifndef __i18n_h__
#define __i18n_h__
#include "pbd/compose.h"
#include "pbd/convert.h"
#include "gettext.h"
#include <vector>
#include <string>
#define _(Text) dgettext (PACKAGE,Text)
#define N_(Text) gettext_noop (Text)
#define X_(Text) Text
#define I18N(Array) PBD::internationalize (PACKAGE, Array)
#endif // __i18n_h__

View file

@ -1,57 +0,0 @@
/*
Ardour9pin interface file
Ben Loftis
Created: 05/18/06 11:07:56
Copyright Harrison Audio, LLC, 2007
*/
#include "powermate.h"
using namespace ARDOUR;
ControlProtocol*
new_powermate_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
{
PowermateControlProtocol* pcp = new PowermateControlProtocol (*s);
if (pcp->set_active (true)) {
delete pcp;
return 0;
}
return pcp;
}
void
delete_powermate_protocol (ControlProtocolDescriptor* /*descriptor*/, ControlProtocol* cp)
{
delete cp;
}
bool
probe_powermate_protocol (ControlProtocolDescriptor* /*descriptor*/)
{
return PowermateControlProtocol::probe ();
}
static ControlProtocolDescriptor powermate_descriptor = {
name : "powermate",
id : "uri://ardour.org/ardour/powermate:0",
ptr : 0,
module : 0,
mandatory : 0,
supports_feedback : false,
probe : probe_powermate_protocol,
initialize : new_powermate_protocol,
destroy : delete_powermate_protocol
};
extern "C" {
ControlProtocolDescriptor*
protocol_descriptor () {
return &powermate_descriptor;
}
}

View file

@ -1,258 +0,0 @@
/*
powermate.cc
Ben Loftis
Created: 03/26/07 20:07:56
*/
#include <linux/input.h>
#include <cstring>
#include <cerrno>
#include <cstdio>
#include <unistd.h>
#include <fcntl.h>
#include <glibmm.h>
#include "pbd/pthread_utils.h"
#include "pbd/xml++.h"
#include "pbd/error.h"
#include "ardour/debug.h"
#include "powermate.h"
#include "i18n.h"
using namespace ARDOUR;
using namespace std;
using namespace sigc;
using namespace PBD;
#define NUM_VALID_PREFIXES 2
static const char *valid_prefix[NUM_VALID_PREFIXES] = {
"Griffin PowerMate",
"Griffin SoundKnob"
};
#define NUM_EVENT_DEVICES 16
int open_powermate (const char *dev, int mode)
{
if (!Glib::file_test (dev, Glib::FILE_TEST_EXISTS)) {
return -1;
}
int fd = open(dev, mode);
int i;
char name[255];
if (fd < 0) {
if (errno != EACCES) {
error << string_compose ("Unable to open \"%1\": %2", dev, strerror(errno)) << endmsg;
}
return -1;
}
/* placate valgrind */
name[0] = '\0';
if (ioctl (fd, EVIOCGNAME (sizeof(name)), name) < 0) {
error << string_compose ("\"%1\": EVIOCGNAME failed: %2", dev, strerror(errno)) << endmsg;
close (fd);
return -1;
}
// it's the correct device if the prefix matches what we expect it to be:
for (i = 0; i < NUM_VALID_PREFIXES; ++i) {
if (!strncasecmp (name, valid_prefix[i], strlen (valid_prefix[i]))) {
return fd;
}
}
close (fd);
return -1;
}
int find_powermate(int mode)
{
char devname[256];
int i, r;
for (i = 0; i < NUM_EVENT_DEVICES; i++) {
sprintf (devname, "/dev/input/event%d", i);
r = open_powermate (devname, mode);
if (r >= 0) {
return r;
}
}
return -1;
}
PowermateControlProtocol::PowermateControlProtocol (Session& s)
: ControlProtocol (s, "powermate")
{
}
PowermateControlProtocol::~PowermateControlProtocol ()
{
set_active (false);
}
bool
PowermateControlProtocol::probe ()
{
int port = find_powermate( O_RDONLY );
if (port < 0) {
if (errno == ENOENT) {
DEBUG_TRACE (DEBUG::ControlProtocols, "Powermate device not found; perhaps you have no powermate connected");
} else {
DEBUG_TRACE (DEBUG::ControlProtocols, string_compose ("powermate: Opening of powermate failed - %1\n", strerror(errno)));
}
return false;
}
close (port);
return true;
}
int
PowermateControlProtocol::set_active (bool inActivate)
{
if (inActivate != _active) {
if (inActivate) {
mPort = find_powermate(O_RDONLY);
if ( mPort < 0 ) {
return -1;
}
if (pthread_create_and_store ("Powermate", &mThread, SerialThreadEntry, this) == 0) {
_active = true;
} else {
return -1;
}
printf("Powermate Control Protocol activated\n");
} else {
pthread_cancel (mThread);
close (mPort);
_active = false;
printf("Powermate Control Protocol deactivated\n");
}
}
return 0;
}
XMLNode&
PowermateControlProtocol::get_state ()
{
XMLNode* node = new XMLNode (X_("Protocol"));
node->add_property (X_("name"), _name);
return *node;
}
int
PowermateControlProtocol::set_state (const XMLNode& /*node*/, int /*version*/)
{
return 0;
}
void*
PowermateControlProtocol::SerialThreadEntry (void* arg)
{
static_cast<PowermateControlProtocol*>(arg)->register_thread ("Powermate");
return static_cast<PowermateControlProtocol*>(arg)->SerialThread ();
}
#define BUFFER_SIZE 32
bool held = false;
bool skippingMarkers = false;
void
PowermateControlProtocol::ProcessEvent(struct input_event *ev)
{
#ifdef VERBOSE
fprintf(stderr, "type=0x%04x, code=0x%04x, value=%d\n",
ev->type, ev->code, (int)ev->value);
#endif
switch(ev->type){
case EV_MSC:
printf("The LED pulse settings were changed; code=0x%04x, value=0x%08x\n", ev->code, ev->value);
break;
case EV_REL:
if(ev->code != REL_DIAL)
fprintf(stderr, "Warning: unexpected rotation event; ev->code = 0x%04x\n", ev->code);
else{
if (held) {
//click and hold to skip forward and back by markers
skippingMarkers = true;;
if (ev->value > 0)
next_marker();
else
prev_marker();
} else {
//scale the range so that we can go from +/-8x within 180 degrees, with less precision at the higher speeds
float speed = get_transport_speed();
speed += (float)ev->value * 0.05;
if (speed > 1.5 || speed < -1.5 )
speed += ev->value;
set_transport_speed( speed );
}
}
break;
case EV_KEY:
if(ev->code != BTN_0)
fprintf(stderr, "Warning: unexpected key event; ev->code = 0x%04x\n", ev->code);
else
if (ev->value)
held = true;
else {
held = false;
if (skippingMarkers) {
skippingMarkers = false;
} else {
if (get_transport_speed() == 0.0) {
set_transport_speed(1.0);
} else {
set_transport_speed(0.0);
}
}
}
break;
}
fflush(stdout);
}
void*
PowermateControlProtocol::SerialThread ()
{
struct input_event ibuffer[BUFFER_SIZE];
int r, events, i;
while(1){
r = read(mPort, ibuffer, sizeof(struct input_event) * BUFFER_SIZE);
if( r > 0 ){
events = r / sizeof(struct input_event);
for(i=0; i<events; i++)
ProcessEvent(&ibuffer[i]);
}else{
fprintf(stderr, "read() failed: %s\n", strerror(errno));
return (void*) 0;
}
}
return (void*) 0;
}

View file

@ -1,34 +0,0 @@
#ifndef ardour_powermate_h
#define ardour_powermate_h
#include <sys/time.h>
#include <pthread.h>
#include "control_protocol/control_protocol.h"
class PowermateControlProtocol : public ARDOUR::ControlProtocol
{
public:
PowermateControlProtocol (ARDOUR::Session&);
virtual ~PowermateControlProtocol();
int set_active (bool yn);
static bool probe ();
XMLNode& get_state ();
int set_state (const XMLNode&, int version);
private:
static void* SerialThreadEntry (void* arg);
void* SerialThread ();
void ProcessEvent(struct input_event *ev);
int mPort;
pthread_t mThread;
};
#endif

View file

@ -1,37 +0,0 @@
#!/usr/bin/env python
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
# major increment <=> incompatible changes
# minor increment <=> compatible changes (additions)
# micro increment <=> no interface changes
LIBARDOUR_POWERMATE_LIB_VERSION = '4.1.0'
# Mandatory variables
top = '.'
out = 'build'
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
interface.cc
powermate.cc
'''
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="ardour_powermate"'
obj.includes = ['.' ]
obj.name = 'libpowermate'
obj.target = 'powermate'
obj.use = 'libardour libardour_cp'
obj.vnum = LIBARDOUR_POWERMATE_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')
def shutdown():
autowaf.shutdown()

View file

@ -25,7 +25,6 @@ children = [
'generic_midi',
'mackie',
'osc',
'powermate',
'tranzport',
'wiimote'
]
@ -48,7 +47,6 @@ def configure(conf):
#if Options.options.tranzport and conf.is_defined('HAVE_USB'):
# conf.define('BUILD_TRANZPORT', 1)
conf.check_cc (header_name='linux/input.h', define_name='BUILD_POWERMATE',mandatory=False)
autowaf.check_pkg (conf, 'liblo', mandatory=False, uselib_store="LO", atleast_version="0.24")
conf.check_cc (header_name='cwiid.h', define_name='HAVE_CWIID_H',mandatory=False)
@ -68,8 +66,6 @@ def build(bld):
bld.recurse('mackie')
if bld.is_defined ('HAVE_LO'):
bld.recurse('osc')
if bld.is_defined('BUILD_POWERMATE'):
bld.recurse('powermate')
if bld.is_defined('BUILD_WIIMOTE'):
bld.recurse('wiimote')
if bld.is_defined('BUILD_TRANZPORT'):

View file

@ -62,9 +62,13 @@ while [ $# -gt 0 ] ; do
esac
done
#release_version=`grep -m 1 '[^A-Za-z_]OSX_VERSION = ' ../../wscript | cut -d' ' -f 3 | sed "s/'//g"`
release_version=3.0
revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d' ' -f 8 | sed 's/[^0-9]//g'`
if test -z "$PRODUCT_PKG_DIR" -o -z "$APPNAME"; then
echo "application or product-name was not specified"
exit 1
fi
release_version=`grep -m 1 '[^A-Za-z_]OSX_VERSION = ' ../../wscript | cut -d"'" -f2`
revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d'"' -f 2 | sed 's/^.*-//g'`
echo "Version is $release_version / $revision"
info_string="$release_version/$revision built on `hostname` by `whoami` on `date`"
echo "Info string is $info_string"