13
0

Merge branch 'ardour'

This commit is contained in:
Robin Gareus 2024-11-10 23:29:59 +01:00
commit 64cc01b0b1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
366 changed files with 6094 additions and 13685 deletions

View File

@ -1323,10 +1323,6 @@
RelativePath="..\gtk2_ardour\tempo_dialog.cc" RelativePath="..\gtk2_ardour\tempo_dialog.cc"
> >
</File> </File>
<File
RelativePath="..\gtk2_ardour\tempo_lines.cc"
>
</File>
<File <File
RelativePath="..\gtk2_ardour\time_axis_view.cc" RelativePath="..\gtk2_ardour\time_axis_view.cc"
> >
@ -1606,7 +1602,7 @@
> >
</File> </File>
<File <File
RelativePath="..\gtk2_ardour\canvas_vars.h" RelativePath="..\gtk2_ardour\canvas_vars.inc.h"
> >
</File> </File>
<File <File
@ -1645,10 +1641,6 @@
RelativePath="..\gtk2_ardour\crossfade_edit.h" RelativePath="..\gtk2_ardour\crossfade_edit.h"
> >
</File> </File>
<File
RelativePath="..\gtk2_ardour\crossfade_view.h"
>
</File>
<File <File
RelativePath="..\gtk2_ardour\cursor_context.h" RelativePath="..\gtk2_ardour\cursor_context.h"
> >
@ -1682,7 +1674,7 @@
> >
</File> </File>
<File <File
RelativePath="..\gtk2_ardour\editing_syms.h" RelativePath="..\gtk2_ardour\editing_syms.inc.h"
> >
</File> </File>
<File <File
@ -1942,7 +1934,7 @@
> >
</File> </File>
<File <File
RelativePath="..\gtk2_ardour\luasignal_syms.h" RelativePath="..\gtk2_ardour\luasignal_syms.inc.h"
> >
</File> </File>
<File <File
@ -2537,10 +2529,6 @@
RelativePath="..\gtk2_ardour\tempo_dialog.h" RelativePath="..\gtk2_ardour\tempo_dialog.h"
> >
</File> </File>
<File
RelativePath="..\gtk2_ardour\tempo_lines.h"
>
</File>
<File <File
RelativePath="..\gtk2_ardour\time_axis_view.h" RelativePath="..\gtk2_ardour\time_axis_view.h"
> >
@ -2610,7 +2598,7 @@
> >
</File> </File>
<File <File
RelativePath="..\gtk2_ardour\ui_config_vars.h" RelativePath="..\gtk2_ardour\ui_config_vars.inc.h"
> >
</File> </File>
<File <File

View File

@ -2,7 +2,7 @@
# This is the GTK style file for Ardour # This is the GTK style file for Ardour
# #
style "very_small_text" style "smaller_text"
{ {
font_name = "%FONT_SMALLER%" font_name = "%FONT_SMALLER%"
} }
@ -431,7 +431,7 @@ style "transport_rec_button_alternate"
bg[ACTIVE] = { 0.91, 0.68, 0.68 } bg[ACTIVE] = { 0.91, 0.68, 0.68 }
} }
style "shuttle_control" = "very_small_text" style "shuttle_control" = "smaller_text"
{ {
fg[NORMAL] = { 0.85, 0.92, 0.98 } fg[NORMAL] = { 0.85, 0.92, 0.98 }
fg[ACTIVE] = { 0.85, 0.92, 0.98 } fg[ACTIVE] = { 0.85, 0.92, 0.98 }
@ -1060,7 +1060,7 @@ style "selected_strip_frame"
bg[NORMAL] = { 0.79, 0.28, 0.18 } bg[NORMAL] = { 0.79, 0.28, 0.18 }
} }
style "flashing_alert" = "very_small_text" style "flashing_alert" = "smaller_text"
{ {
fg[NORMAL] = { 0.80, 0.80, 0.80 } fg[NORMAL] = { 0.80, 0.80, 0.80 }
bg[NORMAL] = { 0.26, 0.26, 0.31 } bg[NORMAL] = { 0.26, 0.26, 0.31 }

View File

@ -434,7 +434,7 @@ style "transport_rec_button_alternate"
bg[ACTIVE] = { 0.91, 0.68, 0.68 } bg[ACTIVE] = { 0.91, 0.68, 0.68 }
} }
style "shuttle_control" = "very_small_text" style "shuttle_control" = "smaller_text"
{ {
fg[NORMAL] = { 0.85, 0.92, 0.98 } fg[NORMAL] = { 0.85, 0.92, 0.98 }
fg[ACTIVE] = { 0.85, 0.92, 0.98 } fg[ACTIVE] = { 0.85, 0.92, 0.98 }
@ -1064,7 +1064,7 @@ style "selected_strip_frame"
bg[NORMAL] = { 0.79, 0.28, 0.18 } bg[NORMAL] = { 0.79, 0.28, 0.18 }
} }
style "flashing_alert" = "very_small_text" style "flashing_alert" = "smaller_text"
{ {
fg[NORMAL] = { 0, 0, 0 } fg[NORMAL] = { 0, 0, 0 }
bg[NORMAL] = { 0.80, 0.80, 0.80 } bg[NORMAL] = { 0.80, 0.80, 0.80 }

View File

@ -2393,7 +2393,10 @@ AudioClock::dpi_reset ()
*/ */
first_width = 0; first_width = 0;
first_height = 0; first_height = 0;
queue_resize ();
if (get_realized ()) {
queue_resize ();
}
} }
void void

View File

@ -22,6 +22,7 @@
#include <gtkmm/box.h> #include <gtkmm/box.h>
#include <gtkmm/label.h> #include <gtkmm/label.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/table.h> #include <gtkmm/table.h>
#include "ardour/ardour.h" #include "ardour/ardour.h"

View File

@ -225,6 +225,19 @@ AutomationLine::hide ()
set_visibility (AutomationLine::VisibleAspects (_visible & ~Line)); set_visibility (AutomationLine::VisibleAspects (_visible & ~Line));
} }
void
AutomationLine::hide_all ()
{
set_visibility (AutomationLine::VisibleAspects (0));
}
void
AutomationLine::show ()
{
/* hide everything */
set_visibility (AutomationLine::VisibleAspects (~0));
}
double double
AutomationLine::control_point_box_size () AutomationLine::control_point_box_size ()
{ {

View File

@ -118,6 +118,8 @@ public:
void remove_visibility (VisibleAspects); void remove_visibility (VisibleAspects);
void hide (); void hide ();
void hide_all ();
void show ();
void set_height (guint32); void set_height (guint32);
bool get_uses_gain_mapping () const; bool get_uses_gain_mapping () const;

View File

@ -33,6 +33,7 @@
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "ardour/automation_control.h"
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
#include "gui_object.h" #include "gui_object.h"

View File

@ -802,7 +802,7 @@ StepView::set_timing_text ()
if (_step.offset() == Temporal::Beats()) { if (_step.offset() == Temporal::Beats()) {
text->set (X_("0")); text->set (X_("0"));
} else { } else {
const int64_t gcd = boost::integer::gcd (_step.offset().to_ticks(), int64_t (1920)); const int64_t gcd = std::gcd (_step.offset().to_ticks(), int64_t (1920));
const int64_t n = _step.offset().to_ticks() / gcd; const int64_t n = _step.offset().to_ticks() / gcd;
const int64_t d = 1920 / gcd; const int64_t d = 1920 / gcd;
text->set (string_compose ("%1/%2", n, d)); text->set (string_compose ("%1/%2", n, d));

View File

@ -20,6 +20,7 @@
#pragma once #pragma once
#include <gtkmm/comboboxtext.h>
#include <gtkmm/entry.h> #include <gtkmm/entry.h>
#include <gtkmm/liststore.h> #include <gtkmm/liststore.h>
#include <gtkmm/treeview.h> #include <gtkmm/treeview.h>

View File

@ -22,8 +22,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
CANVAS_FONT_VARIABLE(SmallFont, "small font") CANVAS_FONT_VARIABLE(VerySmallFont, "very small font")
CANVAS_FONT_VARIABLE(SmallerFont, "smaller font") CANVAS_FONT_VARIABLE(SmallerFont, "smaller font")
CANVAS_FONT_VARIABLE(SmallFont, "small font")
CANVAS_FONT_VARIABLE(NormalFont, "normal font") CANVAS_FONT_VARIABLE(NormalFont, "normal font")
CANVAS_FONT_VARIABLE(BigFont, "big font") CANVAS_FONT_VARIABLE(BigFont, "big font")
CANVAS_FONT_VARIABLE(LargeFont, "large font") CANVAS_FONT_VARIABLE(LargeFont, "large font")

View File

@ -290,7 +290,12 @@ style "status_bar_box"
bg[NORMAL] = @background bg[NORMAL] = @background
} }
style "very_small_text" style "smaller_text"
{
font_name = "@FONTFAMILY@ @FONT_VERYSMALL@"
}
style "smaller_text"
{ {
font_name = "@FONTFAMILY@ @FONT_SMALLER@" font_name = "@FONTFAMILY@ @FONT_SMALLER@"
} }
@ -386,7 +391,7 @@ style "verbose_canvas_cursor" = "big_bold_text"
{ {
} }
style "marker_text" = "small text" style "marker_text" = "small_text"
{ {
} }
@ -400,7 +405,7 @@ style "midi_tracer_textview" = "medium_monospace_text"
} }
style "time_axis_view_item_name" = "very small text" style "time_axis_view_item_name" = "smaller_text"
{ {
} }
@ -409,7 +414,7 @@ style "midi_tracer_textview" = "medium_monospace_text"
} }
style "time_axis_view_item_name" = "very small text" style "time_axis_view_item_name" = "smaller_text"
{ {
} }
style "contrasting_popup" = "medium_monospace_text" style "contrasting_popup" = "medium_monospace_text"
@ -506,15 +511,15 @@ style "meterbridge_label" = "small_text"
{ {
} }
style "midi_device" = "very_small_text" style "midi_device" = "smaller_text"
{ {
} }
style "solo_isolate" = "very_small_text" style "solo_isolate" = "smaller_text"
{ {
} }
style "solo_safe" = "very_small_text" style "solo_safe" = "smaller_text"
{ {
} }
@ -547,7 +552,7 @@ style "midi_channel_selector_button"
fg[ACTIVE] = @light_text_on_dark fg[ACTIVE] = @light_text_on_dark
} }
style "shuttle_control" = "very_small_text" style "shuttle_control" = "smaller_text"
{ {
fg[NORMAL] = @control_text2 fg[NORMAL] = @control_text2
fg[ACTIVE] = @control_text2 fg[ACTIVE] = @control_text2
@ -606,7 +611,7 @@ style "font_scale_slider" = "default"
bg[NORMAL] = shade(1.4, @background) bg[NORMAL] = shade(1.4, @background)
} }
style "very_small_bright_when_active" = "very_small_text" style "very_small_bright_when_active" = "smaller_text"
{ {
fg[NORMAL] = @foreground fg[NORMAL] = @foreground
bg[NORMAL] = @background bg[NORMAL] = @background
@ -761,14 +766,14 @@ style "small_red_on_black_entry" = "small_bold_text"
bg[ACTIVE] = @bases bg[ACTIVE] = @bases
} }
style "audio_bus_base" = "very_small_text" style "audio_bus_base" = "smaller_text"
{ {
fg[NORMAL] = @foreground fg[NORMAL] = @foreground
bg[NORMAL] = @audio_bus bg[NORMAL] = @audio_bus
bg[ACTIVE] = @background bg[ACTIVE] = @background
} }
style "foldback_bus_base" = "very_small_text" style "foldback_bus_base" = "smaller_text"
{ {
fg[NORMAL] = @foreground fg[NORMAL] = @foreground
bg[NORMAL] = @foldback_bg bg[NORMAL] = @foldback_bg
@ -933,7 +938,7 @@ style "plugin_slider"
text[PRELIGHT] = @texts text[PRELIGHT] = @texts
} }
style "processor_control_button" = "very_small_text" style "processor_control_button" = "smaller_text"
{ {
} }
@ -961,7 +966,7 @@ style "inspector_track_list_display" = "track_list_display"
} }
style "processor_list" = "very_small_text" style "processor_list" = "smaller_text"
{ {
bg[NORMAL] = @bases bg[NORMAL] = @bases
bg[ACTIVE] = shade (1.8, @fg_selected) bg[ACTIVE] = shade (1.8, @fg_selected)
@ -1002,7 +1007,7 @@ style "selected_strip_frame"
bg[NORMAL] = darker(@bright_indicator) bg[NORMAL] = darker(@bright_indicator)
} }
style "flashing_alert" = "very_small_text" style "flashing_alert" = "smaller_text"
{ {
GtkButton::child-displacement-x = 0 GtkButton::child-displacement-x = 0
GtkButton::child-displacement-y = 0 GtkButton::child-displacement-y = 0

View File

@ -28,12 +28,17 @@
#include <gtkmm/box.h> #include <gtkmm/box.h>
#include <gtkmm/button.h> #include <gtkmm/button.h>
#include <gtkmm/radiobutton.h> #include <gtkmm/radiobutton.h>
#include <gtkmm/table.h>
#include "canvas/canvas.h" #include "canvas/canvas.h"
#include "canvas/poly_line.h"
#include "evoral/Curve.h" #include "evoral/Curve.h"
#include "ardour/automation_list.h"
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
#include "waveview/wave_view.h"
#include "ardour_dialog.h" #include "ardour_dialog.h"
namespace ARDOUR namespace ARDOUR

View File

@ -1,87 +0,0 @@
/*
* Copyright (C) 2005-2014 Paul Davis <paul@linuxaudiosystems.com>
* Copyright (C) 2005 Nick Mainsbridge <mainsbridge@gmail.com>
* Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
* Copyright (C) 2006-2011 David Robillard <d@drobilla.net>
* Copyright (C) 2007-2011 Carl Hetherington <carl@carlh.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include <vector>
#include "pbd/signals.h"
#include "ardour/crossfade.h"
#include "time_axis_view_item.h"
class RouteTimeAxisView;
class AudioRegionView;
namespace ArdourCanvas {
class PolyLine;
}
class CrossfadeView : public TimeAxisViewItem
{
public:
CrossfadeView (ArdourCanvas::Container*,
RouteTimeAxisView&,
std::shared_ptr<ARDOUR::Crossfade>,
double initial_samples_per_pixel,
Gdk::Color& basic_color,
AudioRegionView& leftview,
AudioRegionView& rightview);
~CrossfadeView ();
std::shared_ptr<ARDOUR::Crossfade> crossfade; // ok, let 'em have it
AudioRegionView& left_view; // and these too
AudioRegionView& right_view;
void set_heights (double, double);
bool valid() const { return _valid; }
bool visible() const { return _visible; }
void set_valid (bool yn);
static PBD::Signal<void(CrossfadeView*)> CatchDeletion;
void fake_hide ();
void hide ();
void show ();
void horizontal_position_changed ();
protected:
void reset_width_dependent_items (double pixel_width);
private:
bool _valid;
bool _visible;
bool _all_in_view;
double _child_height;
ArdourCanvas::PolyLine *fade_in;
ArdourCanvas::PolyLine *fade_out;
void crossfade_changed (const PBD::PropertyChange&);
void crossfade_fades_changed ();
void active_changed ();
void redraw_curves ();
void color_handler ();
};

View File

@ -89,7 +89,7 @@ class CueEditor : public EditingContext, public PBD::HistoryOwner, public sigc::
*/ */
void step_mouse_mode (bool next); void step_mouse_mode (bool next);
/** @return The current mouse mode (gain, object, range, timefx etc.) /** @return The current mouse mode (gain, object, range, timefx etc.)
* (defined in editing_syms.h) * (defined in editing_syms.inc.h)
*/ */
Editing::MouseMode current_mouse_mode () const; Editing::MouseMode current_mouse_mode () const;
/** cue editors are *always* used for internal editing */ /** cue editors are *always* used for internal editing */

View File

@ -22,6 +22,7 @@
#include <gtkmm/window.h> #include <gtkmm/window.h>
#include <gtkmm/colorselection.h> #include <gtkmm/colorselection.h>
#include <gtkmm/menu.h>
#include "pbd/properties.h" #include "pbd/properties.h"

View File

@ -20,6 +20,7 @@
<Option name="font-scale" value="102400"/> <Option name="font-scale" value="102400"/>
</UI> </UI>
<Canvas> <Canvas>
<Option name="very small font" value="@FONT_VERYSMALL@"/>
<Option name="small font" value="@FONT_SMALL@"/> <Option name="small font" value="@FONT_SMALL@"/>
<Option name="smaller font" value="@FONT_SMALLER@"/> <Option name="smaller font" value="@FONT_SMALLER@"/>
<Option name="normal font" value="@FONT_NORMAL@"/> <Option name="normal font" value="@FONT_NORMAL@"/>

View File

@ -44,14 +44,14 @@ namespace Editing {
GridType GridType
str2gridtype (const string & str) { str2gridtype (const string & str) {
const char* type = str.c_str(); const char* type = str.c_str();
#include "editing_syms.h" #include "editing_syms.inc.h"
return GridTypeBar; return GridTypeBar;
} }
#undef GRIDTYPE #undef GRIDTYPE
#define GRIDTYPE(s) N_(#s), #define GRIDTYPE(s) N_(#s),
const char *gridtypestrs[] = { const char *gridtypestrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef GRIDTYPE #undef GRIDTYPE
@ -63,14 +63,14 @@ const char *gridtypestrs[] = {
SnapMode SnapMode
str2snapmode (const string & str) { str2snapmode (const string & str) {
const char* type = str.c_str(); const char* type = str.c_str();
#include "editing_syms.h" #include "editing_syms.inc.h"
return SnapMagnetic; return SnapMagnetic;
} }
#undef SNAPMODE #undef SNAPMODE
#define SNAPMODE(s) N_(#s), #define SNAPMODE(s) N_(#s),
const char *snapmodestrs[] = { const char *snapmodestrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef SNAPMODE #undef SNAPMODE
@ -83,14 +83,14 @@ const char *snapmodestrs[] = {
RegionListSortType RegionListSortType
str2regionlistsorttype (const string & str) { str2regionlistsorttype (const string & str) {
const char* type = str.c_str(); const char* type = str.c_str();
#include "editing_syms.h" #include "editing_syms.inc.h"
return ByName; return ByName;
} }
#undef REGIONLISTSORTTYPE #undef REGIONLISTSORTTYPE
#define REGIONLISTSORTTYPE(s) N_(#s), #define REGIONLISTSORTTYPE(s) N_(#s),
const char *regionlistsorttypestrs[] = { const char *regionlistsorttypestrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef REGIONLISTSORTTYPE #undef REGIONLISTSORTTYPE
@ -102,14 +102,14 @@ const char *regionlistsorttypestrs[] = {
MouseMode MouseMode
str2mousemode (const string & str) { str2mousemode (const string & str) {
const char* type = str.c_str(); const char* type = str.c_str();
#include "editing_syms.h" #include "editing_syms.inc.h"
return MouseObject; return MouseObject;
} }
#undef MOUSEMODE #undef MOUSEMODE
#define MOUSEMODE(s) N_(#s), #define MOUSEMODE(s) N_(#s),
const char *mousemodestrs[] = { const char *mousemodestrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef MOUSEMODE #undef MOUSEMODE
@ -121,14 +121,14 @@ const char *mousemodestrs[] = {
ZoomFocus ZoomFocus
str2zoomfocus (const string & str) { str2zoomfocus (const string & str) {
const char* type = str.c_str(); const char* type = str.c_str();
#include "editing_syms.h" #include "editing_syms.inc.h"
return ZoomFocusPlayhead; return ZoomFocusPlayhead;
} }
#undef ZOOMFOCUS #undef ZOOMFOCUS
#define ZOOMFOCUS(s) N_(#s), #define ZOOMFOCUS(s) N_(#s),
const char *zoomfocusstrs[] = { const char *zoomfocusstrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef ZOOMFOCUS #undef ZOOMFOCUS
@ -140,14 +140,14 @@ const char *zoomfocusstrs[] = {
DisplayControl DisplayControl
str2displaycontrol (const string & str) { str2displaycontrol (const string & str) {
const char* type = str.c_str(); const char* type = str.c_str();
#include "editing_syms.h" #include "editing_syms.inc.h"
return FollowPlayhead; return FollowPlayhead;
} }
#undef DISPLAYCONTROL #undef DISPLAYCONTROL
#define DISPLAYCONTROL(s) N_(#s), #define DISPLAYCONTROL(s) N_(#s),
const char *displaycontrolstrs[] = { const char *displaycontrolstrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef DISPLAYCONTROL #undef DISPLAYCONTROL
@ -157,7 +157,7 @@ const char *displaycontrolstrs[] = {
#undef IMPORTMODE #undef IMPORTMODE
#define IMPORTMODE(s) N_(#s), #define IMPORTMODE(s) N_(#s),
const char *importmodestrs[] = { const char *importmodestrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef IMPORTMODE #undef IMPORTMODE
@ -167,7 +167,7 @@ const char *importmodestrs[] = {
#undef TEMPOEDITBEHAVIOR #undef TEMPOEDITBEHAVIOR
#define TEMPOEDITBEHAVIOR(s) N_(#s), #define TEMPOEDITBEHAVIOR(s) N_(#s),
const char *tempoeditbehaviorstrs[] = { const char *tempoeditbehaviorstrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef TEMPOEDITBEHAVIOR #undef TEMPOEDITBEHAVIOR
@ -176,7 +176,7 @@ const char *tempoeditbehaviorstrs[] = {
#undef NOTENAMEDISPLAY #undef NOTENAMEDISPLAY
#define NOTENAMEDISPLAY(s) N_(#s), #define NOTENAMEDISPLAY(s) N_(#s),
const char *notenamedisplaystrs[] = { const char *notenamedisplaystrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef NOTENAMEDISPLAY #undef NOTENAMEDISPLAY
@ -185,7 +185,7 @@ const char *notenamedisplaystrs[] = {
#undef MARKERCLICKBEHAVIOR #undef MARKERCLICKBEHAVIOR
#define MARKERCLICKBEHAVIOR(s) N_(#s), #define MARKERCLICKBEHAVIOR(s) N_(#s),
const char *markerclickbehaviorstrs[] = { const char *markerclickbehaviorstrs[] = {
#include "editing_syms.h" #include "editing_syms.inc.h"
0 0
}; };
#undef MARKERCLICKBEHAVIOR #undef MARKERCLICKBEHAVIOR

View File

@ -50,7 +50,7 @@ namespace Editing {
#undef GRIDTYPE #undef GRIDTYPE
#define GRIDTYPE(a) a, #define GRIDTYPE(a) a,
enum GridType { enum GridType {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
static const int DRAW_VEL_AUTO = -1; static const int DRAW_VEL_AUTO = -1;
@ -68,7 +68,7 @@ GridType str2gridtype(const std::string &);
#undef SNAPMODE #undef SNAPMODE
#define SNAPMODE(a) a, #define SNAPMODE(a) a,
enum SnapMode { enum SnapMode {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
extern const char *snapmodestrs[]; extern const char *snapmodestrs[];
@ -82,7 +82,7 @@ SnapMode str2snapmode(const std::string &);
#undef REGIONLISTSORTTYPE #undef REGIONLISTSORTTYPE
#define REGIONLISTSORTTYPE(a) a, #define REGIONLISTSORTTYPE(a) a,
enum RegionListSortType { enum RegionListSortType {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
extern const char *regionlistsorttypestrs[]; extern const char *regionlistsorttypestrs[];
@ -96,7 +96,7 @@ RegionListSortType str2regionlistsorttype(const std::string &);
#undef MOUSEMODE #undef MOUSEMODE
#define MOUSEMODE(a) a, #define MOUSEMODE(a) a,
enum MouseMode { enum MouseMode {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
extern const char *mousemodestrs[]; extern const char *mousemodestrs[];
@ -110,7 +110,7 @@ MouseMode str2mousemode(const std::string &);
#undef MIDIEDITMODE #undef MIDIEDITMODE
#define MIDIEDITMODE(a) a, #define MIDIEDITMODE(a) a,
enum MidiEditMode { enum MidiEditMode {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
extern const char *midieditmodestrs[]; extern const char *midieditmodestrs[];
@ -124,7 +124,7 @@ MidiEditMode str2midieditmode(const std::string &);
#undef ZOOMFOCUS #undef ZOOMFOCUS
#define ZOOMFOCUS(a) a, #define ZOOMFOCUS(a) a,
enum ZoomFocus { enum ZoomFocus {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
extern const char *zoomfocusstrs[]; extern const char *zoomfocusstrs[];
@ -138,7 +138,7 @@ ZoomFocus str2zoomfocus(const std::string &);
#undef DISPLAYCONTROL #undef DISPLAYCONTROL
#define DISPLAYCONTROL(a) a, #define DISPLAYCONTROL(a) a,
enum DisplayControl { enum DisplayControl {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
extern const char *displaycontrolstrs[]; extern const char *displaycontrolstrs[];
@ -153,7 +153,7 @@ DisplayControl str2displaycontrol (const std::string &);
#undef IMPORTMODE #undef IMPORTMODE
#define IMPORTMODE(a) a, #define IMPORTMODE(a) a,
enum ImportMode { enum ImportMode {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
#undef IMPORTMODE #undef IMPORTMODE
@ -163,7 +163,7 @@ enum ImportMode {
#undef IMPORTPOSITION #undef IMPORTPOSITION
#define IMPORTPOSITION(a) a, #define IMPORTPOSITION(a) a,
enum ImportPosition { enum ImportPosition {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
#undef IMPORTPOSITION #undef IMPORTPOSITION
@ -173,7 +173,7 @@ enum ImportPosition {
#undef IMPORTDISPOSITION #undef IMPORTDISPOSITION
#define IMPORTDISPOSITION(a) a, #define IMPORTDISPOSITION(a) a,
enum ImportDisposition { enum ImportDisposition {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
#undef IMPORTDISPOSITION #undef IMPORTDISPOSITION
@ -183,7 +183,7 @@ enum ImportDisposition {
#undef EDITPOINT #undef EDITPOINT
#define EDITPOINT(a) a, #define EDITPOINT(a) a,
enum EditPoint { enum EditPoint {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
#undef EDITPOINT #undef EDITPOINT
@ -193,7 +193,7 @@ enum EditPoint {
#undef INSERTTIMEOPT #undef INSERTTIMEOPT
#define INSERTTIMEOPT(a) a, #define INSERTTIMEOPT(a) a,
enum InsertTimeOption { enum InsertTimeOption {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
#undef INSERTTIMEOPT #undef INSERTTIMEOPT
@ -202,7 +202,7 @@ enum InsertTimeOption {
#undef NOTENAMEDISPLAY #undef NOTENAMEDISPLAY
#define NOTENAMEDISPLAY(a) a, #define NOTENAMEDISPLAY(a) a,
enum NoteNameDisplay { enum NoteNameDisplay {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
extern const char *notenamedisplaystrs[]; extern const char *notenamedisplaystrs[];
@ -214,7 +214,7 @@ inline const char* enum2str(NoteNameDisplay m) {return notenamedisplaystrs[m];}
#undef MARKERCLICKBEHAVIOR #undef MARKERCLICKBEHAVIOR
#define MARKERCLICKBEHAVIOR(a) a, #define MARKERCLICKBEHAVIOR(a) a,
enum MarkerClickBehavior { enum MarkerClickBehavior {
#include "editing_syms.h" #include "editing_syms.inc.h"
}; };
#undef MARKERCLICKBEHAVIOR #undef MARKERCLICKBEHAVIOR
#define MARKERCLICKBEHAVIOR(a) /*empty*/ #define MARKERCLICKBEHAVIOR(a) /*empty*/

View File

@ -2469,6 +2469,9 @@ EditingContext::reset_zoom (samplecnt_t spp)
pending_visual_change.add (VisualChange::ZoomLevel); pending_visual_change.add (VisualChange::ZoomLevel);
pending_visual_change.samples_per_pixel = spp; pending_visual_change.samples_per_pixel = spp;
if (spp == 0.0) {
PBD::stacktrace (std::cerr, 12);
}
ensure_visual_change_idle_handler (); ensure_visual_change_idle_handler ();
} }

View File

@ -315,7 +315,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider
void reset_point_selection (); void reset_point_selection ();
/** Set the mouse mode (gain, object, range, timefx etc.) /** Set the mouse mode (gain, object, range, timefx etc.)
* @param m Mouse mode (defined in editing_syms.h) * @param m Mouse mode (defined in editing_syms.inc.h)
* @param force Perform the effects of the change even if no change is required * @param force Perform the effects of the change even if no change is required
* (ie even if the current mouse mode is equal to @p m) * (ie even if the current mouse mode is equal to @p m)
*/ */
@ -325,7 +325,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider
*/ */
virtual void step_mouse_mode (bool next) = 0; virtual void step_mouse_mode (bool next) = 0;
/** @return The current mouse mode (gain, object, range, timefx etc.) /** @return The current mouse mode (gain, object, range, timefx etc.)
* (defined in editing_syms.h) * (defined in editing_syms.inc.h)
*/ */
Editing::MouseMode current_mouse_mode () const { return mouse_mode; } Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
virtual Editing::MouseMode effective_mouse_mode () const { return mouse_mode; } virtual Editing::MouseMode effective_mouse_mode () const { return mouse_mode; }
@ -571,7 +571,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider
QuantizeDialog* quantize_dialog; QuantizeDialog* quantize_dialog;
friend class TempoMapScope; friend struct TempoMapScope;
virtual std::shared_ptr<Temporal::TempoMap const> start_local_tempo_map (std::shared_ptr<Temporal::TempoMap>); virtual std::shared_ptr<Temporal::TempoMap const> start_local_tempo_map (std::shared_ptr<Temporal::TempoMap>);
virtual void end_local_tempo_map (std::shared_ptr<Temporal::TempoMap const>) { /* no-op by default */ } virtual void end_local_tempo_map (std::shared_ptr<Temporal::TempoMap const>) { /* no-op by default */ }

View File

@ -20,6 +20,8 @@
#pragma once #pragma once
#include <gtkmm/box.h>
#include <gtkmm/colorselection.h>
#include <gtkmm/liststore.h> #include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h> #include <gtkmm/scrolledwindow.h>
#include <gtkmm/treemodel.h> #include <gtkmm/treemodel.h>
@ -27,6 +29,9 @@
#include "editor_component.h" #include "editor_component.h"
#include "ardour/route_group.h"
#include "ardour/session_handle.h"
class EditorRouteGroups : public EditorComponent, public ARDOUR::SessionHandlePtr class EditorRouteGroups : public EditorComponent, public ARDOUR::SessionHandlePtr
{ {
public: public:

View File

@ -134,7 +134,11 @@ Editor::initialize_rulers ()
{ {
ruler_grabbed_widget = 0; ruler_grabbed_widget = 0;
Pango::FontDescription font (UIConfiguration::instance().get_SmallerFont()); #ifdef __APPLE__
Pango::FontDescription font (UIConfiguration::instance().get_VerySmallFont());
#else
Pango::FontDescription font (UIConfiguration::instance().get_SmallFont());
#endif
Pango::FontDescription larger_font (UIConfiguration::instance().get_SmallBoldFont()); Pango::FontDescription larger_font (UIConfiguration::instance().get_SmallBoldFont());
_timecode_metric = new TimecodeMetric (this); _timecode_metric = new TimecodeMetric (this);

View File

@ -284,13 +284,13 @@ EditorSections::selection_changed ()
/* OK */ /* OK */
break; break;
case Editing::MouseObject: case Editing::MouseObject:
if (ActionManager::get_toggle_action ("MouseMode", "set-mouse-mode-object-range")->get_active ()) { if (ActionManager::get_toggle_action (PublicEditor::instance().editor_name().c_str(), "set-mouse-mode-object-range")->get_active ()) {
/* smart mode; OK */ /* smart mode; OK */
break; break;
} }
/*fallthrough*/ /*fallthrough*/
default: default:
Glib::RefPtr<RadioAction> ract = ActionManager::get_radio_action (X_("MouseMode"), X_("set-mouse-mode-range")); Glib::RefPtr<RadioAction> ract = ActionManager::get_radio_action (PublicEditor::instance().editor_name().c_str(), X_("set-mouse-mode-range"));
ract->set_active (true); ract->set_active (true);
break; break;
} }

View File

@ -21,7 +21,11 @@
#pragma once #pragma once
#include "ardour/session_handle.h"
#include "ardour/types.h"
#include "gtkmm2ext/cairo_widget.h" #include "gtkmm2ext/cairo_widget.h"
#include "pbd/property_basics.h"
#include "editor_component.h" #include "editor_component.h"
namespace ARDOUR { namespace ARDOUR {
@ -29,6 +33,8 @@ namespace ARDOUR {
} }
class Editor; class Editor;
class RegionView;
class RouteTimeAxisView;
/** Class to provide a visual summary of the contents of an editor window; represents /** Class to provide a visual summary of the contents of an editor window; represents
* the whole session as a set of lines, one per region view. * the whole session as a set of lines, one per region view.

View File

@ -303,6 +303,7 @@ Editor::tempo_map_changed ()
reset_metric_marks (); reset_metric_marks ();
update_tempo_based_rulers (); update_tempo_based_rulers ();
update_section_rects();
update_all_marker_lanes (); update_all_marker_lanes ();
maybe_draw_grid_lines (); maybe_draw_grid_lines ();
} }

View File

@ -1,6 +1,7 @@
#ifndef __gtk2_ardour_ghost_event_h__ #ifndef __gtk2_ardour_ghost_event_h__
#define __gtk2_ardour_ghost_event_h__ #define __gtk2_ardour_ghost_event_h__
#include <memory>
#include <unordered_map> #include <unordered_map>
#include <sigc++/trackable.h> #include <sigc++/trackable.h>

View File

@ -192,7 +192,6 @@ MidiGhostRegion::MidiGhostRegion(MidiRegionView& rv,
: GhostRegion(rv, tv.ghost_group(), tv, source_tv, initial_unit_pos) : GhostRegion(rv, tv.ghost_group(), tv, source_tv, initial_unit_pos)
, _note_group (new ArdourCanvas::Container (group)) , _note_group (new ArdourCanvas::Container (group))
, parent_mrv (rv) , parent_mrv (rv)
, _optimization_iterator(events.end())
{ {
_outline = UIConfiguration::instance().color ("ghost track midi outline"); _outline = UIConfiguration::instance().color ("ghost track midi outline");
@ -298,7 +297,6 @@ MidiGhostRegion::add_note (NoteBase* n)
{ {
GhostEvent* event = new GhostEvent (n, _note_group); GhostEvent* event = new GhostEvent (n, _note_group);
events.insert (make_pair (n->note(), event)); events.insert (make_pair (n->note(), event));
_optimization_iterator = events.end();
event->item->set_fill_color (UIConfiguration::instance().color_mod(n->base_color(), "ghost track midi fill")); event->item->set_fill_color (UIConfiguration::instance().color_mod(n->base_color(), "ghost track midi fill"));
event->item->set_outline_color (_outline); event->item->set_outline_color (_outline);
@ -332,7 +330,6 @@ MidiGhostRegion::clear_events()
{ {
_note_group->clear (true); _note_group->clear (true);
events.clear (); events.clear ();
_optimization_iterator = events.end();
} }
/** Update the positions of our representation of a note. /** Update the positions of our representation of a note.
@ -393,8 +390,6 @@ MidiGhostRegion::remove_note (NoteBase* note)
delete f->second; delete f->second;
events.erase (f); events.erase (f);
_optimization_iterator = events.end ();
} }
void void

View File

@ -133,6 +133,5 @@ public:
GhostEvent* find_event (std::shared_ptr<GhostEvent::NoteType>); GhostEvent* find_event (std::shared_ptr<GhostEvent::NoteType>);
GhostEvent::EventList events; GhostEvent::EventList events;
GhostEvent::EventList::iterator _optimization_iterator;
}; };

View File

@ -18,6 +18,7 @@
#pragma once #pragma once
#include "canvas/container.h"
#include "canvas/line_set.h" #include "canvas/line_set.h"
#include "canvas/ruler.h" #include "canvas/ruler.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"

View File

@ -26,6 +26,7 @@
#include <gtkmm/menu.h> #include <gtkmm/menu.h>
#include "ardour/data_type.h" #include "ardour/data_type.h"
#include "ardour/types.h"
#include "widgets/ardour_button.h" #include "widgets/ardour_button.h"

View File

@ -22,6 +22,7 @@
#include <string> #include <string>
#include <gtkmm/action.h>
#include <gtkmm/buttonbox.h> #include <gtkmm/buttonbox.h>
#include <gtkmm/notebook.h> #include <gtkmm/notebook.h>
#include <gtkmm/scrolledwindow.h> #include <gtkmm/scrolledwindow.h>

View File

@ -19,6 +19,11 @@
#ifndef _gtkardour_loudness_settings_h_ #ifndef _gtkardour_loudness_settings_h_
#define _gtkardour_loudness_settings_h_ #define _gtkardour_loudness_settings_h_
#include <cstddef>
#include <stdexcept>
#include <string>
#include <vector>
class XMLNode; class XMLNode;
struct CLoudnessPreset struct CLoudnessPreset

View File

@ -591,6 +591,35 @@ protected:
Gtk::FileChooserWidget _fc; Gtk::FileChooserWidget _fc;
}; };
class LuaDialogText : public LuaDialogWidget
{
public:
LuaDialogText (std::string const& key, std::string const& title, std::string const& dflt)
: LuaDialogWidget (key, title)
{
_text_view.set_wrap_mode (Gtk::WRAP_WORD);
_text_view.get_buffer()->set_text (dflt);
_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
_scrolled_window.add(_text_view);
}
Gtk::Widget* widget ()
{
return &_scrolled_window;
}
void assign (luabridge::LuaRef* rv) const
{
(*rv)[_key] = std::string (_text_view.get_buffer()->get_text());
}
protected:
Gtk::TextView _text_view;
Gtk::ScrolledWindow _scrolled_window;
};
/* ***************************************************************************** /* *****************************************************************************
* Lua Parameter Dialog * Lua Parameter Dialog
*/ */
@ -659,6 +688,12 @@ Dialog::Dialog (std::string const& title, luabridge::LuaRef lr)
dflt = i.value ()["default"].cast<std::string> (); dflt = i.value ()["default"].cast<std::string> ();
} }
w = new LuaDialogEntry (key, title, dflt); w = new LuaDialogEntry (key, title, dflt);
} else if (type == "textarea") {
std::string dflt;
if (i.value ()["default"].isString ()) {
dflt = i.value ()["default"].cast<std::string> ();
}
w = new LuaDialogText (key, title, dflt);
} else if (type == "radio") { } else if (type == "radio") {
std::string dflt; std::string dflt;
if (!i.value ()["values"].isTable ()) { if (!i.value ()["values"].isTable ()) {

View File

@ -365,7 +365,7 @@ LuaSignal
str2luasignal (const std::string &str) { str2luasignal (const std::string &str) {
const char* type = str.c_str(); const char* type = str.c_str();
if (0) { } if (0) { }
# include "luasignal_syms.h" # include "luasignal_syms.inc.h"
else { else {
PBD::fatal << string_compose (_("programming error: %1: %2"), "Impossible LuaSignal type", str) << endmsg; PBD::fatal << string_compose (_("programming error: %1: %2"), "Impossible LuaSignal type", str) << endmsg;
abort(); /*NOTREACHED*/ abort(); /*NOTREACHED*/
@ -379,7 +379,7 @@ str2luasignal (const std::string &str) {
#define SESSION(name,c) N_(#name), #define SESSION(name,c) N_(#name),
#define ENGINE(name,c) N_(#name), #define ENGINE(name,c) N_(#name),
const char *luasignalstr[] = { const char *luasignalstr[] = {
# include "luasignal_syms.h" # include "luasignal_syms.inc.h"
0 0
}; };
@ -551,7 +551,7 @@ LuaInstance::register_hooks (lua_State* L)
#define SESSION(name,c) .addConst (stringify(name), (LuaSignal::LuaSignal)LuaSignal::name) #define SESSION(name,c) .addConst (stringify(name), (LuaSignal::LuaSignal)LuaSignal::name)
luabridge::getGlobalNamespace (L) luabridge::getGlobalNamespace (L)
.beginNamespace ("LuaSignal") .beginNamespace ("LuaSignal")
# include "luasignal_syms.h" # include "luasignal_syms.inc.h"
.endNamespace (); .endNamespace ();
#undef ENGINE #undef ENGINE
#undef SESSION #undef SESSION
@ -1115,7 +1115,7 @@ LuaInstance::register_classes (lua_State* L, bool sandbox)
.addFunction ("set_" # var, &UIConfiguration::set_##var) \ .addFunction ("set_" # var, &UIConfiguration::set_##var) \
.addProperty (#var, &UIConfiguration::get_##var, &UIConfiguration::set_##var) .addProperty (#var, &UIConfiguration::get_##var, &UIConfiguration::set_##var)
#include "ui_config_vars.h" #include "ui_config_vars.inc.h"
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
.endClass() .endClass()
@ -1147,7 +1147,7 @@ LuaInstance::register_classes (lua_State* L, bool sandbox)
#define NOTENAMEDISPLAY(NAME) .addConst (stringify(NAME), (Editing::NoteNameDisplay)Editing::NAME) #define NOTENAMEDISPLAY(NAME) .addConst (stringify(NAME), (Editing::NoteNameDisplay)Editing::NAME)
luabridge::getGlobalNamespace (L) luabridge::getGlobalNamespace (L)
.beginNamespace ("Editing") .beginNamespace ("Editing")
# include "editing_syms.h" # include "editing_syms.inc.h"
.endNamespace (); .endNamespace ();
if (!sandbox) { if (!sandbox) {
@ -2380,7 +2380,7 @@ LuaCallback::reconnect_object (T obj)
#define SESSION(n,c) else if (i == LuaSignal::n) { if (_session) { connect (LuaSignal::n, _session, &(_session->c)); } } #define SESSION(n,c) else if (i == LuaSignal::n) { if (_session) { connect (LuaSignal::n, _session, &(_session->c)); } }
#define STATIC(n,c) else if (i == LuaSignal::n) { connect (LuaSignal::n, obj, c); } #define STATIC(n,c) else if (i == LuaSignal::n) { connect (LuaSignal::n, obj, c); }
if (0) {} if (0) {}
# include "luasignal_syms.h" # include "luasignal_syms.inc.h"
else { else {
PBD::fatal << string_compose (_("programming error: %1: %2"), "Impossible LuaSignal type", i) << endmsg; PBD::fatal << string_compose (_("programming error: %1: %2"), "Impossible LuaSignal type", i) << endmsg;
abort(); /*NOTREACHED*/ abort(); /*NOTREACHED*/

View File

@ -17,6 +17,9 @@
*/ */
#ifndef _luasignal_h_ #ifndef _luasignal_h_
#define _luasignal_h_ #define _luasignal_h_
#include <string>
namespace LuaSignal { namespace LuaSignal {
#define ENGINE(name,c) name, #define ENGINE(name,c) name,
@ -24,7 +27,7 @@ namespace LuaSignal {
#define SESSION(name,c) name, #define SESSION(name,c) name,
enum LuaSignal { enum LuaSignal {
# include "luasignal_syms.h" # include "luasignal_syms.inc.h"
LAST_SIGNAL LAST_SIGNAL
}; };

View File

@ -40,6 +40,8 @@
#include "widgets/ardour_button.h" #include "widgets/ardour_button.h"
#include "widgets/ardour_dropdown.h" #include "widgets/ardour_dropdown.h"
#include "ardour_window.h"
class LuaWindow : class LuaWindow :
public ArdourWindow, public ArdourWindow,
public PBD::ScopedConnectionList public PBD::ScopedConnectionList

View File

@ -466,7 +466,7 @@ MidiCueEditor::toolbox ()
} }
void void
MidiCueEditor::data_captured (timecnt_t total_duration) MidiCueEditor::data_captured (samplecnt_t total_duration)
{ {
data_capture_duration = total_duration; data_capture_duration = total_duration;
@ -474,14 +474,13 @@ MidiCueEditor::data_captured (timecnt_t total_duration)
Glib::signal_idle().connect (sigc::mem_fun (*this, &MidiCueEditor::idle_data_captured)); Glib::signal_idle().connect (sigc::mem_fun (*this, &MidiCueEditor::idle_data_captured));
} }
samplepos_t pos = data_capture_duration.end().samples(); _playhead_cursor->set_position (data_capture_duration);
_playhead_cursor->set_position (pos);
} }
bool bool
MidiCueEditor::idle_data_captured () MidiCueEditor::idle_data_captured ()
{ {
double where = duration_to_pixels (data_capture_duration); double where = sample_to_pixel_unrounded (data_capture_duration);
if (where > _visible_canvas_width * 0.80) { if (where > _visible_canvas_width * 0.80) {
set_samples_per_pixel (samples_per_pixel * 1.5); set_samples_per_pixel (samples_per_pixel * 1.5);
@ -494,95 +493,19 @@ MidiCueEditor::idle_data_captured ()
return false; return false;
} }
void
MidiCueEditor::set_box (std::shared_ptr<ARDOUR::TriggerBox> b)
{
capture_connections.drop_connections ();
idle_update_queued.store (0);
if (b) {
b->Captured.connect (capture_connections, invalidator (*this), std::bind (&MidiCueEditor::data_captured, this, _1), gui_context());
/* Don't bind a shared_ptr<TriggerBox> within the lambda */
TriggerBox* tb (b.get());
b->RecEnableChanged.connect (capture_connections, invalidator (*this), [&, tb]() { box_rec_enable_change (*tb); }, gui_context());
}
}
void void
MidiCueEditor::box_rec_enable_change (ARDOUR::TriggerBox const & b) MidiCueEditor::box_rec_enable_change (ARDOUR::TriggerBox const & b)
{ {
if (b.record_enabled()) {
view->begin_write();
} else {
view->end_write ();
}
} }
void void
MidiCueEditor::trigger_rec_enable_change (ARDOUR::Trigger const & t) MidiCueEditor::trigger_rec_enable_change (ARDOUR::Trigger const & t)
{ {
if (t.armed()) { if (!t.armed()) {
view->begin_write();
} else {
view->end_write (); view->end_write ();
} }
} }
void
MidiCueEditor::set_track (std::shared_ptr<ARDOUR::MidiTrack> t)
{
_track = t;
view->set_track (t);
_update_connection.disconnect ();
capture_connections.drop_connections ();
if (t) {
set_box (t->triggerbox());
_update_connection = Timers::rapid_connect (sigc::mem_fun (*this, &MidiCueEditor::maybe_update));
_track->DropReferences.connect (track_connection, invalidator (*this), std::bind (&MidiCueEditor::set_track, this, nullptr), gui_context());
} else {
set_box (nullptr);
}
}
void
MidiCueEditor::set_region (std::shared_ptr<ARDOUR::MidiRegion> r)
{
if (!r) {
view->set_region (nullptr);
return;
}
view->set_region (r);
/* Compute zoom level to show entire source plus some margin if possible */
Temporal::timecnt_t duration = Temporal::timecnt_t (r->midi_source()->length().beats());
bool provided = false;
std::shared_ptr<Temporal::TempoMap> map;
std::shared_ptr<SMFSource> smf (std::dynamic_pointer_cast<SMFSource> (r->midi_source()));
if (smf) {
map = smf->tempo_map (provided);
}
if (!provided) {
map.reset (new Temporal::TempoMap (Temporal::Tempo (120, 4), Temporal::Meter (4, 4)));
}
{
EditingContext::TempoMapScope tms (*this, map);
double width = bg->width();
samplecnt_t samples = duration.samples();
samplecnt_t spp = floor (samples / width);
reset_zoom (spp);
}
}
bool bool
MidiCueEditor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) MidiCueEditor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{ {
@ -1697,8 +1620,9 @@ MidiCueEditor::enter_handler (ArdourCanvas::Item* item, GdkEvent* ev, ItemType i
switch (item_type) { switch (item_type) {
case AutomationTrackItem: case AutomationTrackItem:
/* item is the base rectangle */ /* item is the base rectangle */
al = reinterpret_cast<EditorAutomationLine*> (item->get_data ("line")); if (view) {
al->track_entered (); view->automation_entry ();
}
break; break;
case EditorAutomationLineItem: case EditorAutomationLineItem:
@ -1740,7 +1664,7 @@ MidiCueEditor::leave_handler (ArdourCanvas::Item* item, GdkEvent* ev, ItemType i
} }
} }
if (ev->crossing.detail != GDK_NOTIFY_INFERIOR) { if (ev->crossing.detail != GDK_NOTIFY_INFERIOR) {
al->track_exited (); view->automation_leave ();
} }
break; break;
@ -1761,3 +1685,98 @@ MidiCueEditor::selectable_owners()
return std::list<SelectableOwner*> (); return std::list<SelectableOwner*> ();
} }
void
MidiCueEditor::trigger_prop_change (PBD::PropertyChange const & what_changed)
{
if (what_changed.contains (Properties::region)) {
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion> (ref.trigger()->the_region());
if (mr) {
set_region (mr);
}
}
}
void
MidiCueEditor::set (TriggerReference & tref)
{
_update_connection.disconnect ();
object_connections.drop_connections ();
ref = tref;
idle_update_queued.store (0);
ref.box()->Captured.connect (object_connections, invalidator (*this), std::bind (&MidiCueEditor::data_captured, this, _1), gui_context());
/* Don't bind a shared_ptr<TriggerBox> within the lambda */
TriggerBox* tb (ref.box().get());
tb->RecEnableChanged.connect (object_connections, invalidator (*this), [&, tb]() { box_rec_enable_change (*tb); }, gui_context());
Stripable* st = dynamic_cast<Stripable*> (ref.box()->owner());
assert (st);
_track = std::dynamic_pointer_cast<MidiTrack> (st->shared_from_this());
assert (_track);
view->set_track (_track);
_update_connection = Timers::rapid_connect (sigc::mem_fun (*this, &MidiCueEditor::maybe_update));
_track->DropReferences.connect (object_connections, invalidator (*this), std::bind (&MidiCueEditor::unset, this), gui_context());
ref.trigger()->PropertyChanged.connect (object_connections, invalidator (*this), std::bind (&MidiCueEditor::trigger_prop_change, this, _1), gui_context());
if (ref.trigger()->the_region()) {
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion> (ref.trigger()->the_region());
if (mr) {
set_region (mr);
}
}
}
void
MidiCueEditor::unset ()
{
_update_connection.disconnect();
object_connections.drop_connections ();
_track.reset ();
view->set_region (nullptr);
ref = TriggerReference ();
}
void
MidiCueEditor::set_region (std::shared_ptr<ARDOUR::MidiRegion> r)
{
if (!r) {
view->set_region (nullptr);
return;
}
view->set_region (r);
/* Compute zoom level to show entire source plus some margin if possible */
Temporal::timecnt_t duration = Temporal::timecnt_t (r->midi_source()->length().beats());
std::cerr << "new region: " << duration << std::endl;
bool provided = false;
std::shared_ptr<Temporal::TempoMap> map;
std::shared_ptr<SMFSource> smf (std::dynamic_pointer_cast<SMFSource> (r->midi_source()));
if (smf) {
map = smf->tempo_map (provided);
}
if (!provided) {
map.reset (new Temporal::TempoMap (Temporal::Tempo (120, 4), Temporal::Meter (4, 4)));
}
{
EditingContext::TempoMapScope tms (*this, map);
double width = bg->width();
samplecnt_t samples = duration.samples();
std::cerr << "new spp from " << samples << " / " << width << std::endl;
samplecnt_t spp = floor (samples / width);
reset_zoom (spp);
}
}

View File

@ -72,9 +72,8 @@ class MidiCueEditor : public CueEditor
int32_t get_grid_beat_divisions (Editing::GridType gt) const { return 1; } int32_t get_grid_beat_divisions (Editing::GridType gt) const { return 1; }
int32_t get_grid_music_divisions (Editing::GridType gt, uint32_t event_state) const { return 1; } int32_t get_grid_music_divisions (Editing::GridType gt, uint32_t event_state) const { return 1; }
void set (ARDOUR::TriggerReference&);
void set_region (std::shared_ptr<ARDOUR::MidiRegion>); void set_region (std::shared_ptr<ARDOUR::MidiRegion>);
void set_box (std::shared_ptr<ARDOUR::TriggerBox>);
void set_track (std::shared_ptr<ARDOUR::MidiTrack>);
ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; } ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; }
ArdourCanvas::ScrollGroup* get_cursor_scroll_group () const { return cursor_scroll_group; } ArdourCanvas::ScrollGroup* get_cursor_scroll_group () const { return cursor_scroll_group; }
@ -140,6 +139,7 @@ class MidiCueEditor : public CueEditor
void on_samples_per_pixel_changed (); void on_samples_per_pixel_changed ();
private: private:
ARDOUR::TriggerReference ref;
std::shared_ptr<ARDOUR::MidiTrack> _track; std::shared_ptr<ARDOUR::MidiTrack> _track;
ArdourCanvas::GtkCanvasViewport* _canvas_viewport; ArdourCanvas::GtkCanvasViewport* _canvas_viewport;
ArdourCanvas::GtkCanvas* _canvas; ArdourCanvas::GtkCanvas* _canvas;
@ -208,17 +208,20 @@ class MidiCueEditor : public CueEditor
void stop_canvas_autoscroll (); void stop_canvas_autoscroll ();
sigc::connection _update_connection; sigc::connection _update_connection;
PBD::ScopedConnection track_connection; PBD::ScopedConnectionList object_connections;
void maybe_update (); void maybe_update ();
void trigger_prop_change (PBD::PropertyChange const &);
void unset ();
void visual_changer (const VisualChange&); void visual_changer (const VisualChange&);
void bindings_changed (); void bindings_changed ();
void data_captured (Temporal::timecnt_t); void data_captured (samplecnt_t);
bool idle_data_captured (); bool idle_data_captured ();
std::atomic<int> idle_update_queued; std::atomic<int> idle_update_queued;
PBD::ScopedConnectionList capture_connections; PBD::ScopedConnectionList capture_connections;
Temporal::timecnt_t data_capture_duration; samplecnt_t data_capture_duration;
}; };

View File

@ -20,9 +20,12 @@
#include "ardour/midi_source.h" #include "ardour/midi_source.h"
#include "ardour/midi_track.h" #include "ardour/midi_track.h"
#include "ardour/triggerbox.h" #include "ardour/triggerbox.h"
#include "ardour/types.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "canvas/box.h"
#include "canvas/button.h"
#include "canvas/debug.h" #include "canvas/debug.h"
#include "editing_context.h" #include "editing_context.h"
@ -39,6 +42,7 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
MidiCueView::MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> mt, MidiCueView::MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> mt,
@ -48,12 +52,14 @@ MidiCueView::MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> mt,
MidiViewBackground& bg, MidiViewBackground& bg,
uint32_t basic_color) uint32_t basic_color)
: MidiView (mt, parent, ec, bg, basic_color) : MidiView (mt, parent, ec, bg, basic_color)
, velocity_base (nullptr) , active_automation (nullptr)
, velocity_display (nullptr) , velocity_display (nullptr)
, _slot_index (slot_index) , _slot_index (slot_index)
{ {
CANVAS_DEBUG_NAME (_note_group, X_("note group for MIDI cue")); CANVAS_DEBUG_NAME (_note_group, X_("note group for MIDI cue"));
_needs_active_notes_for_rec_enabled_track = true;
/* Containers don't get canvas events, so we need an invisible rect /* Containers don't get canvas events, so we need an invisible rect
* that will. It will be resized as needed sothat it always covers the * that will. It will be resized as needed sothat it always covers the
* entire canvas/view. * entire canvas/view.
@ -73,38 +79,72 @@ MidiCueView::MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> mt,
automation_group->set_fill_color (UIConfiguration::instance().color ("midi automation track fill")); automation_group->set_fill_color (UIConfiguration::instance().color ("midi automation track fill"));
automation_group->set_data ("linemerger", this); automation_group->set_data ("linemerger", this);
velocity_base = new ArdourCanvas::Rectangle (&parent); button_bar = new ArdourCanvas::Box (&parent, ArdourCanvas::Box::Horizontal);
CANVAS_DEBUG_NAME (velocity_base, "cue velocity base"); CANVAS_DEBUG_NAME (button_bar, "button bar");
velocity_display = new MidiCueVelocityDisplay (editing_context(), midi_context(), *this, *velocity_base, 0x312244ff); button_bar->set_spacing (12.);
/* Right-side padding only */
button_bar->set_padding (0., 0., 0., 24.);
button_bar->set_margin (5., 5., 5., 5.);
for (auto & ev : _events) { Pango::FontDescription button_font = UIConfiguration::instance().get_NormalFont();
velocity_display->add_note (ev.second);
} velocity_button = new ArdourCanvas::Button (button_bar, _("Velocity"), button_font);
velocity_button->text()->set_color (UIConfiguration::instance().color ("neutral:foreground"));
CANVAS_DEBUG_NAME (velocity_button, "velocity button");
bender_button = new ArdourCanvas::Button (button_bar, _("Bender"), button_font);
bender_button->text()->set_color (UIConfiguration::instance().color ("neutral:foreground"));
CANVAS_DEBUG_NAME (bender_button, "bender button");
pressure_button = new ArdourCanvas::Button (button_bar, _("Pressure"), button_font);
pressure_button->text()->set_color (UIConfiguration::instance().color ("neutral:foreground"));
CANVAS_DEBUG_NAME (pressure_button, "pressure button");
expression_button = new ArdourCanvas::Button (button_bar, _("Expression"), button_font);
expression_button->text()->set_color (UIConfiguration::instance().color ("neutral:foreground"));
CANVAS_DEBUG_NAME (expression_button, "expression button");
modulation_button = new ArdourCanvas::Button (button_bar, _("Modulation"), button_font);
modulation_button->text()->set_color (UIConfiguration::instance().color ("neutral:foreground"));
CANVAS_DEBUG_NAME (modulation_button, "modulation button");
velocity_button->Event.connect (sigc::bind (sigc::mem_fun (*this, &MidiCueView::automation_button_event), ARDOUR::MidiVelocityAutomation, 0));
pressure_button->Event.connect (sigc::bind (sigc::mem_fun (*this, &MidiCueView::automation_button_event), ARDOUR::MidiChannelPressureAutomation, 0));
bender_button->Event.connect (sigc::bind (sigc::mem_fun (*this, &MidiCueView::automation_button_event), ARDOUR::MidiPitchBenderAutomation, 0));
modulation_button->Event.connect (sigc::bind (sigc::mem_fun (*this, &MidiCueView::automation_button_event), ARDOUR::MidiCCAutomation, MIDI_CTL_MSB_MODWHEEL));
expression_button->Event.connect (sigc::bind (sigc::mem_fun (*this, &MidiCueView::automation_button_event), ARDOUR::MidiCCAutomation, MIDI_CTL_MSB_EXPRESSION));
set_extensible (true); set_extensible (true);
Evoral::Parameter fully_qualified_param (ARDOUR::MidiCCAutomation, 0, MIDI_CTL_MSB_MODWHEEL); /* show velocity by default */
show_automation (fully_qualified_param);
update_automation_display (Evoral::Parameter (MidiVelocityAutomation, 0, 0), SelectionSet);
}
MidiCueView::~MidiCueView ()
{
delete velocity_display;
} }
void void
MidiCueView::set_height (double h) MidiCueView::set_height (double h)
{ {
double note_area_height = ceil (h / 2.); double bbw, bbh;
double velocity_height = ceil ((h - note_area_height) / 2.); button_bar->size_request (bbw, bbh);
double automation_height = h - note_area_height - velocity_height;
double note_area_height = ceil ((h - bbh) / 2.);
double automation_height = ceil (h - bbh - note_area_height);
event_rect->set (ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, note_area_height)); event_rect->set (ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, note_area_height));
midi_context().set_size (ArdourCanvas::COORD_MAX, note_area_height); midi_context().set_size (midi_context().width(), note_area_height);
velocity_base->set_position (ArdourCanvas::Duple (0., note_area_height)); automation_group->set_position (ArdourCanvas::Duple (0., note_area_height));
velocity_base->set (ArdourCanvas::Rect (0., 0., ArdourCanvas::COORD_MAX, velocity_height));
automation_group->set_position (ArdourCanvas::Duple (0., note_area_height + velocity_height));
automation_group->set (ArdourCanvas::Rect (0., 0., ArdourCanvas::COORD_MAX, automation_height)); automation_group->set (ArdourCanvas::Rect (0., 0., ArdourCanvas::COORD_MAX, automation_height));
if (automation_line) { button_bar->size_allocate (ArdourCanvas::Rect (0., note_area_height + automation_height, ArdourCanvas::COORD_MAX, note_area_height + automation_height + bbh));
automation_line->set_height (automation_height);
for (auto & ads : automation_map) {
ads.second.set_height (automation_height);
} }
view_changed (); view_changed ();
@ -235,8 +275,31 @@ MidiCueView::update_hit (Hit* h)
} }
} }
bool
MidiCueView::automation_button_event (GdkEvent* ev, Evoral::ParameterType type, int id)
{
SelectionOperation op = ArdourKeyboard::selection_type (ev->button.state);
switch (ev->type) {
case GDK_BUTTON_RELEASE:
automation_button_click (type, id, op);
break;
default:
break;
}
return false;
}
void void
MidiCueView::show_automation (Evoral::Parameter const & param) MidiCueView::automation_button_click (Evoral::ParameterType type, int id, SelectionOperation op)
{
#warning paul allow channel selection (2nd param)
update_automation_display (Evoral::Parameter (type, 0, id), op);
}
void
MidiCueView::update_automation_display (Evoral::Parameter const & param, SelectionOperation op)
{ {
using namespace ARDOUR; using namespace ARDOUR;
@ -244,52 +307,110 @@ MidiCueView::show_automation (Evoral::Parameter const & param)
return; return;
} }
if (param.type() == NullAutomation) {
return;
}
// if (automation_line && automation_line->param() == param) {
// return;
// }
automation_line.reset ();
automation_control.reset ();
std::shared_ptr<AutomationControl> control;
switch (param.type()) { switch (param.type()) {
case MidiCCAutomation: case MidiCCAutomation:
case MidiPgmChangeAutomation: case MidiPgmChangeAutomation:
case MidiPitchBenderAutomation: case MidiPitchBenderAutomation:
case MidiChannelPressureAutomation: case MidiChannelPressureAutomation:
case MidiNotePressureAutomation: case MidiNotePressureAutomation:
case MidiSystemExclusiveAutomation: { case MidiSystemExclusiveAutomation:
/* These controllers are region "automation" - they are owned case MidiVelocityAutomation:
* by regions (and their MidiModels), not by the track. As a
* result there is no AutomationList/Line for the track, but we create
* a controller for the user to write immediate events, so the editor
* can act as a control surface for the present MIDI controllers.
*
* TODO: Record manipulation of the controller to regions?
*/
std::shared_ptr<Evoral::Control> control = _midi_region->model()->control (param, true);
automation_control = std::dynamic_pointer_cast<AutomationControl> (control);
if (automation_control) {
automation_line.reset (new MidiCueAutomationLine ("whatevs",
_editing_context,
*automation_group,
automation_group,
automation_control->alist(),
automation_control->desc()));
automation_line->set_height (automation_group->get().height());
}
break; break;
default:
return;
} }
default: CueAutomationMap::iterator i = automation_map.find (param);
AutomationDisplayState* ads = nullptr;
if (i != automation_map.end()) {
ads = &i->second;
} else {
if (op == SelectionRemove) {
/* remove it, but it doesn't exist yet, no worries */
return;
}
if (param.type() == MidiVelocityAutomation) {
if (!velocity_display) {
/* Create and add to automation display map */
velocity_display = new MidiCueVelocityDisplay (editing_context(), midi_context(), *this, *automation_group, 0x312244ff);
auto res = automation_map.insert (std::make_pair (Evoral::Parameter (ARDOUR::MidiVelocityAutomation, 0, 0), AutomationDisplayState (*velocity_display, true)));
ads = &((*res.first).second);
for (auto & ev : _events) {
velocity_display->add_note (ev.second);
}
}
} else {
std::shared_ptr<Evoral::Control> control = _midi_region->model()->control (param, true);
CueAutomationControl ac = std::dynamic_pointer_cast<AutomationControl> (control);
if (!ac) {
return;
}
CueAutomationLine line (new MidiCueAutomationLine (ARDOUR::EventTypeMap::instance().to_symbol (param),
_editing_context,
*automation_group,
automation_group,
ac->alist(),
ac->desc()));
AutomationDisplayState cad (ac, line, true);
auto res = automation_map.insert (std::make_pair (param, cad));
ads = &((*res.first).second);
}
}
std::cerr << "sad " << op << " param " << ARDOUR::EventTypeMap::instance().to_symbol (param) << std::endl;
switch (op) {
case SelectionSet:
/* hide the rest */
for (auto & as : automation_map) {
as.second.hide ();
}
/*FALLTHRU*/
case SelectionAdd:
ads->set_height (automation_group->get().height());
ads->show ();
active_automation = ads;
break;
case SelectionRemove:
ads->hide ();
if (active_automation == ads) {
active_automation = nullptr;
}
break;
case SelectionToggle:
if (ads->visible) {
ads->hide ();
if (active_automation == ads) {
active_automation = nullptr;
}
} else {
ads->set_height (automation_group->get().height());
ads->show ();
active_automation = ads;
}
return;
case SelectionExtend:
/* undefined in this context */
break; break;
} }
} }
@ -298,8 +419,8 @@ std::list<SelectableOwner*>
MidiCueView::selectable_owners() MidiCueView::selectable_owners()
{ {
std::list<SelectableOwner*> sl; std::list<SelectableOwner*> sl;
if (automation_line) { if (active_automation && active_automation->line) {
sl.push_back (automation_line.get()); sl.push_back (active_automation->line.get());
} }
return sl; return sl;
} }
@ -307,16 +428,24 @@ MidiCueView::selectable_owners()
MergeableLine* MergeableLine*
MidiCueView::make_merger () MidiCueView::make_merger ()
{ {
return new MergeableLine (automation_line, automation_control, if (active_automation && active_automation->line) {
[](Temporal::timepos_t const& t) { return t; }, return new MergeableLine (active_automation->line, active_automation->control,
nullptr, nullptr); [](Temporal::timepos_t const& t) { return t; },
nullptr, nullptr);
}
return nullptr;
} }
bool bool
MidiCueView::automation_rb_click (GdkEvent* event, Temporal::timepos_t const & pos) MidiCueView::automation_rb_click (GdkEvent* event, Temporal::timepos_t const & pos)
{ {
if (!active_automation || !active_automation->control || !active_automation->line) {
return false;
}
bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier); bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
automation_line->add (automation_control, event, pos, event->button.y, with_guard_points); active_automation->line->add (active_automation->control, event, pos, event->button.y, with_guard_points);
return false; return false;
} }
@ -325,4 +454,60 @@ MidiCueView::line_drag_click (GdkEvent* event, Temporal::timepos_t const & pos)
{ {
} }
MidiCueView::AutomationDisplayState::~AutomationDisplayState()
{
/* We do not own the velocity_display */
}
void
MidiCueView::AutomationDisplayState::hide ()
{
if (velocity_display) {
std::cerr << "hide vdisp\n";
velocity_display->hide ();
} else if (line) {
std::cerr << "hide line\n";
line->hide_all ();
}
visible = false;
}
void
MidiCueView::AutomationDisplayState::show ()
{
if (velocity_display) {
std::cerr << "show vdisp\n";
velocity_display->show ();
} else if (line) {
std::cerr << "show line\n";
line->show ();
}
visible = true;
}
void
MidiCueView::AutomationDisplayState::set_height (double h)
{
if (velocity_display) {
// velocity_display->set_height (h);
} else if (line) {
line->set_height (h);
}
}
void
MidiCueView::automation_entry ()
{
if (active_automation && active_automation->line) {
active_automation->line->track_entered ();
}
}
void
MidiCueView::automation_leave ()
{
if (active_automation && active_automation->line) {
active_automation->line->track_entered ();
}
}

View File

@ -24,11 +24,20 @@
#pragma once #pragma once
#include <map>
#include "ardour/types.h"
#include "midi_view.h" #include "midi_view.h"
class VelocityDisplay; class VelocityDisplay;
class MidiCueAutomationLine; class MidiCueAutomationLine;
namespace ArdourCanvas {
class Box;
class Button;
}
class MidiCueView : public MidiView class MidiCueView : public MidiView
{ {
public: public:
@ -40,6 +49,8 @@ class MidiCueView : public MidiView
uint32_t basic_color uint32_t basic_color
); );
~MidiCueView();
bool canvas_event (GdkEvent*); bool canvas_event (GdkEvent*);
void set_samples_per_pixel (double); void set_samples_per_pixel (double);
void set_height (double); void set_height (double);
@ -51,7 +62,7 @@ class MidiCueView : public MidiView
void ghost_add_note (NoteBase*); void ghost_add_note (NoteBase*);
void ghost_sync_selection (NoteBase*); void ghost_sync_selection (NoteBase*);
void show_automation (Evoral::Parameter const & param); void update_automation_display (Evoral::Parameter const & param, ARDOUR::SelectionOperation);
ArdourCanvas::Item* drag_group() const; ArdourCanvas::Item* drag_group() const;
@ -61,16 +72,50 @@ class MidiCueView : public MidiView
bool automation_rb_click (GdkEvent*, Temporal::timepos_t const &); bool automation_rb_click (GdkEvent*, Temporal::timepos_t const &);
void line_drag_click (GdkEvent*, Temporal::timepos_t const &); void line_drag_click (GdkEvent*, Temporal::timepos_t const &);
void automation_entry();
void automation_leave ();
protected: protected:
bool scroll (GdkEventScroll* ev); bool scroll (GdkEventScroll* ev);
ArdourCanvas::Rectangle* automation_group; ArdourCanvas::Rectangle* automation_group;
std::shared_ptr<MidiCueAutomationLine> automation_line;
std::shared_ptr<ARDOUR::AutomationControl> automation_control;
ArdourCanvas::Rectangle* velocity_base; typedef std::shared_ptr<MidiCueAutomationLine> CueAutomationLine;
typedef std::shared_ptr<ARDOUR::AutomationControl> CueAutomationControl;
struct AutomationDisplayState {
AutomationDisplayState (CueAutomationControl ctl, CueAutomationLine ln, bool vis)
: control (ctl), line (ln), velocity_display (nullptr), visible (vis) {}
AutomationDisplayState (VelocityDisplay& vdisp, bool vis)
: control (nullptr), line (nullptr), velocity_display (&vdisp), visible (vis) {}
~AutomationDisplayState();
CueAutomationControl control;
CueAutomationLine line;
VelocityDisplay* velocity_display;
bool visible;
void hide ();
void show ();
void set_height (double);
};
typedef std::map<Evoral::Parameter, AutomationDisplayState> CueAutomationMap;
CueAutomationMap automation_map;
AutomationDisplayState* active_automation;
VelocityDisplay* velocity_display; VelocityDisplay* velocity_display;
ArdourCanvas::Box* button_bar;
ArdourCanvas::Button* velocity_button;
ArdourCanvas::Button* bender_button;
ArdourCanvas::Button* pressure_button;
ArdourCanvas::Button* expression_button;
ArdourCanvas::Button* modulation_button;
std::shared_ptr<Temporal::TempoMap const> tempo_map; std::shared_ptr<Temporal::TempoMap const> tempo_map;
ArdourCanvas::Rectangle* event_rect; ArdourCanvas::Rectangle* event_rect;
uint32_t _slot_index; uint32_t _slot_index;
@ -78,6 +123,6 @@ class MidiCueView : public MidiView
void update_sustained (Note *); void update_sustained (Note *);
void update_hit (Hit *); void update_hit (Hit *);
bool automation_button_event (GdkEvent*, Evoral::ParameterType type, int id);
void automation_button_click (Evoral::ParameterType type, int id, ARDOUR::SelectionOperation);
}; };

View File

@ -170,6 +170,20 @@ MidiRegionView::init (bool /*wfd*/)
connect_to_diskstream (); connect_to_diskstream ();
} }
void
MidiRegionView::set_model (std::shared_ptr<ARDOUR::MidiModel> model)
{
MidiView::set_model (model);
region_muted ();
region_sync_changed ();
region_resized (ARDOUR::bounds_change);
region_locked ();
set_colors ();
reset_width_dependent_items (_pixel_width);
}
bool bool
MidiRegionView::display_is_enabled () const MidiRegionView::display_is_enabled () const
{ {
@ -642,24 +656,8 @@ MidiRegionView::~MidiRegionView ()
void void
MidiRegionView::reset_width_dependent_items (double pixel_width) MidiRegionView::reset_width_dependent_items (double pixel_width)
{ {
RegionView::reset_width_dependent_items(pixel_width); MidiView::reset_width_dependent_items (pixel_width);
RegionView::reset_width_dependent_items (pixel_width);
view_changed ();
bool hide_all = false;
PatchChanges::iterator x = _patch_changes.begin();
if (x != _patch_changes.end()) {
hide_all = x->second->width() >= _pixel_width;
}
if (hide_all) {
for (; x != _patch_changes.end(); ++x) {
x->second->hide();
}
}
move_step_edit_cursor (_step_edit_cursor_position);
set_step_edit_cursor_width (_step_edit_cursor_width);
} }
void void

View File

@ -112,6 +112,7 @@ public:
{ return midi_view()->midi_view(); } { return midi_view()->midi_view(); }
void set_height (double); void set_height (double);
void set_model (std::shared_ptr<ARDOUR::MidiModel>);
inline ARDOUR::ColorMode color_mode() const { return midi_view()->color_mode(); } inline ARDOUR::ColorMode color_mode() const { return midi_view()->color_mode(); }

View File

@ -19,6 +19,8 @@
#pragma once #pragma once
#include <cstdint>
inline static void clamp_to_0_127(uint8_t &val) inline static void clamp_to_0_127(uint8_t &val)
{ {
if ((127 < val) && (val < 192)) { if ((127 < val) && (val < 192)) {

View File

@ -113,13 +113,14 @@ MidiView::MidiView (std::shared_ptr<MidiTrack> mt,
uint32_t basic_color) uint32_t basic_color)
: _editing_context (ec) : _editing_context (ec)
, _midi_context (bg) , _midi_context (bg)
, _active_notes (0) , _active_notes (nullptr)
, _note_group (new ArdourCanvas::Container (&parent)) , _note_group (new ArdourCanvas::Container (&parent))
, _note_diff_command (nullptr) , _note_diff_command (nullptr)
, _ghost_note(0) , _ghost_note(0)
, _step_edit_cursor (0) , _step_edit_cursor (0)
, _step_edit_cursor_width (1, 0) , _step_edit_cursor_width (1, 0)
, _channel_selection_scoped_note (0) , _channel_selection_scoped_note (0)
, _needs_active_notes_for_rec_enabled_track (false)
, _mouse_state(None) , _mouse_state(None)
, _pressed_button(0) , _pressed_button(0)
, _optimization_iterator (_events.end()) , _optimization_iterator (_events.end())
@ -139,19 +140,19 @@ MidiView::MidiView (std::shared_ptr<MidiTrack> mt,
init (mt); init (mt);
} }
MidiView::MidiView (MidiView const & other) MidiView::MidiView (MidiView const & other)
: sigc::trackable (other) : sigc::trackable (other)
, _editing_context (other.editing_context()) , _editing_context (other.editing_context())
, _midi_context (other.midi_context()) , _midi_context (other.midi_context())
, _midi_region (other.midi_region()) , _midi_region (other.midi_region())
, _active_notes(0) , _active_notes (nullptr)
, _note_group (new ArdourCanvas::Container (other._note_group->parent())) , _note_group (new ArdourCanvas::Container (other._note_group->parent()))
, _note_diff_command (0) , _note_diff_command (0)
, _ghost_note(0) , _ghost_note(0)
, _step_edit_cursor (0) , _step_edit_cursor (0)
, _step_edit_cursor_width (1, 0) , _step_edit_cursor_width (1, 0)
, _channel_selection_scoped_note (0) , _channel_selection_scoped_note (0)
, _needs_active_notes_for_rec_enabled_track (false)
, _mouse_state(None) , _mouse_state(None)
, _pressed_button(0) , _pressed_button(0)
, _optimization_iterator (_events.end()) , _optimization_iterator (_events.end())
@ -192,12 +193,6 @@ MidiView::set_track (std::shared_ptr<MidiTrack> mt)
if (_midi_track) { if (_midi_track) {
_midi_track->DropReferences.connect (track_going_away_connection, invalidator (*this), std::bind (&MidiView::track_going_away, this), gui_context()); _midi_track->DropReferences.connect (track_going_away_connection, invalidator (*this), std::bind (&MidiView::track_going_away, this), gui_context());
if (_midi_track->triggerbox()->record_enabled()) {
begin_write ();
} else {
end_write ();
}
} }
} }
@ -236,23 +231,20 @@ MidiView::set_model (std::shared_ptr<MidiModel> m)
assert (_midi_track); assert (_midi_track);
assert (_midi_region); assert (_midi_region);
clear_events ();
connections_requiring_model.drop_connections ();
_model = m; _model = m;
if (!_model) {
std::cerr << "no model!\n";
return;
}
std::cerr << "model set to " << _model << std::endl;
//set_height (trackview.current_height()); //set_height (trackview.current_height());
#warning paul pianorule needs these fixed
/* XXXX
region_muted ();
region_sync_changed ();
region_resized (ARDOUR::bounds_change);
//region_locked ();
set_colors ();
reset_width_dependent_items (_pixel_width);
*/
connections_requiring_model.drop_connections ();
_model->ContentsChanged.connect (connections_requiring_model, invalidator (*this), std::bind (&MidiView::model_changed, this), gui_context()); _model->ContentsChanged.connect (connections_requiring_model, invalidator (*this), std::bind (&MidiView::model_changed, this), gui_context());
_midi_track->playback_filter().ChannelModeChanged.connect (connections_requiring_model, invalidator (*this), _midi_track->playback_filter().ChannelModeChanged.connect (connections_requiring_model, invalidator (*this),
@ -849,9 +841,8 @@ MidiView::clear_events ()
{ {
// clear selection without signaling or trying to change state of event objects // clear selection without signaling or trying to change state of event objects
_selection.clear (); _selection.clear ();
clear_ghost_events (); clear_ghost_events ();
/* This will delete all the NoteBase* in the _events map */
_note_group->clear (true); _note_group->clear (true);
_events.clear(); _events.clear();
_patch_changes.clear(); _patch_changes.clear();
@ -863,8 +854,6 @@ void
MidiView::display_model (std::shared_ptr<MidiModel> model) MidiView::display_model (std::shared_ptr<MidiModel> model)
{ {
set_model (_model); set_model (_model);
/* Don't signal as nobody else needs to know until selection has been altered. */
clear_events();
model_changed (); model_changed ();
} }
@ -1099,12 +1088,14 @@ MidiView::model_changed()
return; return;
} }
if (!_model) { for (_optimization_iterator = _events.begin(); _optimization_iterator != _events.end(); ++_optimization_iterator) {
return; _optimization_iterator->second->invalidate ();
} }
for (_optimization_iterator = _events.begin(); _optimization_iterator != _events.end(); ++_optimization_iterator) { /* note that _optimization_iterator now points to _events.end() */
_optimization_iterator->second->invalidate();
if (!_model) {
return;
} }
bool empty_when_starting = _events.empty(); bool empty_when_starting = _events.empty();
@ -1565,6 +1556,8 @@ MidiView::begin_write()
XXX this should not happen. XXX this should not happen.
*/ */
clear_events ();
if (_active_notes) { if (_active_notes) {
for (unsigned i = 0; i < 128; ++i) { for (unsigned i = 0; i < 128; ++i) {
delete _active_notes[i]; delete _active_notes[i];
@ -1588,6 +1581,7 @@ void
MidiView::end_write() MidiView::end_write()
{ {
if (_active_notes) { if (_active_notes) {
std::cerr << "active notes deleted in end_write\n";
for (unsigned i = 0; i < 128; ++i) { for (unsigned i = 0; i < 128; ++i) {
delete _active_notes[i]; delete _active_notes[i];
} }
@ -2271,7 +2265,7 @@ MidiView::clear_selection_internal ()
DEBUG_TRACE(DEBUG::Selection, "MRV::clear_selection_internal\n"); DEBUG_TRACE(DEBUG::Selection, "MRV::clear_selection_internal\n");
for (auto & sel : _selection) { for (auto & sel : _selection) {
sel->set_selected(false); sel->set_selected (false);
sel->hide_velocity(); sel->hide_velocity();
ghost_sync_selection (sel); ghost_sync_selection (sel);
} }
@ -4490,15 +4484,14 @@ MidiView::set_step_edit_cursor_width (Temporal::Beats beats)
} }
void void
MidiView::clip_data_recorded (timecnt_t const & total_duration) MidiView::clip_data_recorded (samplecnt_t total_duration)
{ {
if (!_midi_track) { if (!_midi_track) {
return; return;
} }
if (!_active_notes) { if (!_active_notes) {
/* we aren't actively being recorded to */ begin_write ();
return;
} }
if (_active_notes) { if (_active_notes) {
@ -4565,7 +4558,7 @@ MidiView::clip_data_recorded (timecnt_t const & total_duration)
} }
} }
active_note_end = total_duration; active_note_end = timecnt_t (total_duration);
} }
/** Called when a diskstream on our track has received some data. Update the view, if applicable. /** Called when a diskstream on our track has received some data. Update the view, if applicable.

View File

@ -118,9 +118,9 @@ class MidiView : public virtual sigc::trackable, public LineMerger
virtual GhostRegion* add_ghost (TimeAxisView&) { return nullptr; } virtual GhostRegion* add_ghost (TimeAxisView&) { return nullptr; }
virtual std::string get_modifier_name() const; virtual std::string get_modifier_name() const;
void set_region (std::shared_ptr<ARDOUR::MidiRegion>); virtual void set_region (std::shared_ptr<ARDOUR::MidiRegion>);
void set_track (std::shared_ptr<ARDOUR::MidiTrack>); virtual void set_track (std::shared_ptr<ARDOUR::MidiTrack>);
void set_model (std::shared_ptr<ARDOUR::MidiModel>); virtual void set_model (std::shared_ptr<ARDOUR::MidiModel>);
NoteBase* add_note(const std::shared_ptr<NoteType> note, bool visible); NoteBase* add_note(const std::shared_ptr<NoteType> note, bool visible);
@ -341,7 +341,7 @@ class MidiView : public virtual sigc::trackable, public LineMerger
EditingContext& editing_context() const { return _editing_context; } EditingContext& editing_context() const { return _editing_context; }
MidiViewBackground& midi_context() const { return _midi_context; } MidiViewBackground& midi_context() const { return _midi_context; }
void clip_data_recorded (Temporal::timecnt_t const &); void clip_data_recorded (samplecnt_t);
virtual void select_self (bool add) {} virtual void select_self (bool add) {}
virtual void unselect_self () {} virtual void unselect_self () {}
@ -503,7 +503,7 @@ class MidiView : public virtual sigc::trackable, public LineMerger
Temporal::Beats _step_edit_cursor_width; Temporal::Beats _step_edit_cursor_width;
Temporal::Beats _step_edit_cursor_position; Temporal::Beats _step_edit_cursor_position;
NoteBase* _channel_selection_scoped_note; NoteBase* _channel_selection_scoped_note;
bool _needs_active_notes_for_rec_enabled_track;
MouseState _mouse_state; MouseState _mouse_state;
int _pressed_button; int _pressed_button;

View File

@ -42,6 +42,7 @@ MidiViewBackground::MidiViewBackground (ArdourCanvas::Item* parent)
, _note_lines (new ArdourCanvas::LineSet (parent, ArdourCanvas::LineSet::Horizontal)) , _note_lines (new ArdourCanvas::LineSet (parent, ArdourCanvas::LineSet::Horizontal))
, _note_mode (ARDOUR::Sustained) , _note_mode (ARDOUR::Sustained)
, _color_mode (ARDOUR::MeterColors) , _color_mode (ARDOUR::MeterColors)
, _visibility_note_range (ContentsRange)
{ {
_note_lines->lower_to_bottom(); _note_lines->lower_to_bottom();

View File

@ -26,6 +26,10 @@
* Held centrally by the Editor because some cursors are used in several places. * Held centrally by the Editor because some cursors are used in several places.
*/ */
#include <gdkmm/cursor.h>
#include <string>
class MouseCursors class MouseCursors
{ {
public: public:

View File

@ -21,6 +21,7 @@
#include "progress_reporter.h" #include "progress_reporter.h"
namespace Gtk { namespace Gtk {
class CheckButton;
class RadioButton; class RadioButton;
class SpinButton; class SpinButton;
class ProgressBar; class ProgressBar;

View File

@ -29,13 +29,13 @@
#include "note_base.h" #include "note_base.h"
#include "editing_context.h" #include "editing_context.h"
#include "editing_syms.h" #include "editing_syms.inc.h"
#include "keyboard.h" #include "keyboard.h"
#include "midi_view.h" #include "midi_view.h"
/* clang-format off */ /* clang-format off */
// Include last, when GRIDTYPE has been defined by editing.h via midi_region_view.h // Include last, when GRIDTYPE has been defined by editing.h via midi_region_view.h
#include "editing_syms.h" #include "editing_syms.inc.h"
/* clang-format on */ /* clang-format on */
using namespace std; using namespace std;

View File

@ -49,6 +49,7 @@ namespace ARDOUR {
} }
namespace Gtk { namespace Gtk {
class CheckMenuItem;
class Menu; class Menu;
class Menuitem; class Menuitem;
} }

View File

@ -23,6 +23,11 @@
#include "canvas/flag.h" #include "canvas/flag.h"
#include <gtkmm/menu.h>
#include "midi_view.h"
#include "patch_change_dialog.h"
class MidiRegionView; class MidiRegionView;
namespace MIDI { namespace MIDI {

View File

@ -19,6 +19,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#pragma once
#include <gtkmm/comboboxtext.h>
#include <gtkmm/spinbutton.h> #include <gtkmm/spinbutton.h>
#include <gtkmm/comboboxtext.h> #include <gtkmm/comboboxtext.h>
@ -27,7 +30,6 @@
#include "audio_clock.h" #include "audio_clock.h"
namespace ARDOUR { namespace ARDOUR {
class BeatsSamplesConverter;
class Session; class Session;
class InstrumentInfo; class InstrumentInfo;
} }

View File

@ -18,6 +18,8 @@
#pragma once #pragma once
#include <string>
namespace ARDOUR { namespace ARDOUR {
void pingback (const std::string& this_version, void pingback (const std::string& this_version,
const std::string& announce_path); const std::string& announce_path);

View File

@ -28,6 +28,8 @@
#include <gtkmm/treestore.h> #include <gtkmm/treestore.h>
#include <gtkmm/treeview.h> #include <gtkmm/treeview.h>
#include "widgets/ardour_button.h"
#include "ardour/playlist.h" #include "ardour/playlist.h"
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
#include "ardour_dialog.h" #include "ardour_dialog.h"

View File

@ -21,6 +21,7 @@
#include <gtkmm/box.h> #include <gtkmm/box.h>
#include <gtkmm/button.h> #include <gtkmm/button.h>
#include <gtkmm/frame.h>
#include <gtkmm/label.h> #include <gtkmm/label.h>
#include <gtkmm/progressbar.h> #include <gtkmm/progressbar.h>
#include <gtkmm/sizegroup.h> #include <gtkmm/sizegroup.h>

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,9 @@
#pragma once #pragma once
#include "port_matrix_component.h" #include "ardour/bundle.h"
namespace ARDOUR { #include "port_matrix_component.h"
class BundleChannel;
}
class PortMatrixLabels : public PortMatrixComponent class PortMatrixLabels : public PortMatrixComponent
{ {

View File

@ -10,9 +10,6 @@
# [never-do-that-thing] # [never-do-that-thing]
# thing that action prevent never stop otherthing # thing that action prevent never stop otherthing
# #
# The file is processed via tools/process-metadata to create build/gtk2_ardour/configuration_metadata.h which is then incorporated via an #include directive
# within gtk2_ardour/ui_config.cc
#
# Whenever a new preference variable is added to the source code, its name should also be added here. # Whenever a new preference variable is added to the source code, its name should also be added here.
# #
# GUIDANCE: # GUIDANCE:
@ -20,6 +17,12 @@
# use "synchronization" rather than sync, because that will match both "sync" and "synchronization". For languages that create plurals with a suffix, # use "synchronization" rather than sync, because that will match both "sync" and "synchronization". For languages that create plurals with a suffix,
# prefer plural forms for the same reason. # prefer plural forms for the same reason.
# #
# This file is processed automatically when invoking a custom tool manually:
#
# tools/process-metadata gtk2_ardour/preference-metadata > gtk2_ardour/configuration_metadata.inc.h
#
# The generated file is incorporated via an #include directive within gtk2_ardour/ui_config.cc .
[SECTION:UI] [SECTION:UI]
[action-table-columns] [action-table-columns]
@ -623,7 +626,6 @@
osc open sound control osc open sound control
[use-plugin-own-gui] [use-plugin-own-gui]
plugins GUI editor prefer use own plugins GUI editor prefer use own
[use-tranzport]
[use-vst3] [use-vst3]
plugins vst3 plugins vst3
[use-windows-vst] [use-windows-vst]

View File

@ -26,6 +26,8 @@
#include "canvas/rectangle.h" #include "canvas/rectangle.h"
#include <gtkmm/adjustment.h>
namespace ARDOUR { namespace ARDOUR {
class MidiTrack; class MidiTrack;
} }

View File

@ -715,7 +715,7 @@ ProcessorEntry::show_all_controls ()
(*i)->set_visible (true); (*i)->set_visible (true);
} }
_parent->update_gui_object_state (this); _parent->update_gui_object_state (this, true);
} }
void void
@ -725,7 +725,7 @@ ProcessorEntry::hide_all_controls ()
(*i)->set_visible (false); (*i)->set_visible (false);
} }
_parent->update_gui_object_state (this); _parent->update_gui_object_state (this, true);
} }
void void
@ -942,14 +942,14 @@ ProcessorEntry::toggle_inline_display_visibility ()
} else { } else {
_plugin_display->show(); _plugin_display->show();
} }
_parent->update_gui_object_state (this); _parent->update_gui_object_state (this, true);
} }
void void
ProcessorEntry::toggle_control_visibility (Control* c) ProcessorEntry::toggle_control_visibility (Control* c)
{ {
c->set_visible (!c->visible ()); c->set_visible (!c->visible ());
_parent->update_gui_object_state (this); _parent->update_gui_object_state (this, true);
} }
Menu* Menu*
@ -4691,7 +4691,7 @@ ProcessorBox::entry_gui_object_state (ProcessorEntry* entry)
} }
void void
ProcessorBox::update_gui_object_state (ProcessorEntry* entry) ProcessorBox::update_gui_object_state (ProcessorEntry* entry, bool emit)
{ {
XMLNode* proc = entry_gui_object_state (entry); XMLNode* proc = entry_gui_object_state (entry);
if (!proc) { if (!proc) {
@ -4701,6 +4701,12 @@ ProcessorBox::update_gui_object_state (ProcessorEntry* entry)
/* XXX: this is a bit inefficient; we just remove all child nodes and re-add them */ /* XXX: this is a bit inefficient; we just remove all child nodes and re-add them */
proc->remove_nodes_and_delete (X_("Object")); proc->remove_nodes_and_delete (X_("Object"));
entry->add_control_state (proc); entry->add_control_state (proc);
/* notify other strips to update */
if (emit && _route) {
PBD::Unwinder<bool> uw (no_processor_redisplay, true);
_route->processors_changed (RouteProcessorChange ());
}
} }
bool bool

View File

@ -461,7 +461,7 @@ public:
void edit_processor (std::shared_ptr<ARDOUR::Processor>); void edit_processor (std::shared_ptr<ARDOUR::Processor>);
void generic_edit_processor (std::shared_ptr<ARDOUR::Processor>); void generic_edit_processor (std::shared_ptr<ARDOUR::Processor>);
void update_gui_object_state (ProcessorEntry *); void update_gui_object_state (ProcessorEntry *, bool emit = false);
sigc::signal<void,std::shared_ptr<ARDOUR::Processor> > ProcessorSelected; sigc::signal<void,std::shared_ptr<ARDOUR::Processor> > ProcessorSelected;
sigc::signal<void,std::shared_ptr<ARDOUR::Processor> > ProcessorUnselected; sigc::signal<void,std::shared_ptr<ARDOUR::Processor> > ProcessorUnselected;

View File

@ -116,7 +116,9 @@ DurationInfoBox::dpi_reset ()
_layout_value->get_pixel_size (wv, hv); _layout_value->get_pixel_size (wv, hv);
_width = 8 + wv; _width = 8 + wv;
_height = 4 + hv; _height = 4 + hv;
queue_resize (); if (get_realized ()) {
queue_resize ();
}
} }
void void
@ -198,7 +200,9 @@ XrunInfoBox::dpi_reset ()
_layout_value->get_pixel_size (wv, hv); _layout_value->get_pixel_size (wv, hv);
_width = 8 + wv; _width = 8 + wv;
_height = 8 + hv; _height = 8 + hv;
queue_resize (); if (get_realized ()) {
queue_resize ();
}
} }
void void
@ -291,7 +295,9 @@ RemainInfoBox::dpi_reset ()
_width = 8 + std::max (wl, wv); _width = 8 + std::max (wl, wv);
_height = 2 + hv + 2 + hl + 2; _height = 2 + hv + 2 + hl + 2;
queue_resize (); if (get_realized ()) {
queue_resize ();
}
} }
void void

View File

@ -31,6 +31,8 @@
#include "ardour_window.h" #include "ardour_window.h"
#include "audio_clock.h" #include "audio_clock.h"
#include "region_view.h"
#include "time_axis_view.h"
class PublicEditor; class PublicEditor;

View File

@ -36,7 +36,7 @@ public:
RegionPeakCursor (ArdourCanvas::Item*); RegionPeakCursor (ArdourCanvas::Item*);
~RegionPeakCursor (); ~RegionPeakCursor ();
void set (AudioRegionView*, samplepos_t, samplecnt_t); void set (AudioRegionView*, samplepos_t, ARDOUR::samplecnt_t);
void hide (); void hide ();
bool visible () const; bool visible () const;

View File

@ -22,6 +22,9 @@
#include "ardour/route_group.h" #include "ardour/route_group.h"
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
#include <gtkmm/menu.h>
#include <gtkmm/radiomenuitem.h>
class RouteGroupDialog; class RouteGroupDialog;
class RouteGroupMenu : public ARDOUR::SessionHandlePtr class RouteGroupMenu : public ARDOUR::SessionHandlePtr

View File

@ -21,6 +21,8 @@
#pragma once #pragma once
#include <vector> #include <vector>
#include "pbd/property_basics.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "processor_selection.h" #include "processor_selection.h"

View File

@ -41,6 +41,7 @@
#include <gtkmm/spinbutton.h> #include <gtkmm/spinbutton.h>
#include <gtkmm/liststore.h> #include <gtkmm/liststore.h>
#include <gtkmm/combobox.h> #include <gtkmm/combobox.h>
#include <gtkmm/comboboxtext.h>
#include "temporal/domain_provider.h" #include "temporal/domain_provider.h"

View File

@ -44,7 +44,7 @@ public:
get_vbox()->pack_start (*cancel_button, Gtk::PACK_SHRINK); get_vbox()->pack_start (*cancel_button, Gtk::PACK_SHRINK);
} }
void update_progress (samplecnt_t c, samplecnt_t t) { void update_progress (ARDOUR::samplecnt_t c, ARDOUR::samplecnt_t t) {
pbar->set_fraction ((float) c / (float) t); pbar->set_fraction ((float) c / (float) t);
// see also ARDOUR_UI::gui_idle_handler(); // see also ARDOUR_UI::gui_idle_handler();
int timeout = 30; int timeout = 30;

View File

@ -19,6 +19,8 @@
#include <gtkmm/progressbar.h> #include <gtkmm/progressbar.h>
#include <gtkmm/table.h> #include <gtkmm/table.h>
#include "ardour/session_handle.h"
class SoundcloudExportSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr class SoundcloudExportSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr
{ {
public: public:

View File

@ -25,6 +25,11 @@
#include "ardour/types.h" #include "ardour/types.h"
namespace Gtk
{
class Window;
} // namespace Gtk
class ArdourDialog; class ArdourDialog;
class NewUserWizard; class NewUserWizard;
class EngineControl; class EngineControl;

View File

@ -28,10 +28,12 @@
#include "pbd/signals.h" #include "pbd/signals.h"
#include "temporal/beats.h" #include "temporal/beats.h"
#include "temporal/timeline.h"
namespace ARDOUR { namespace ARDOUR {
class MidiTrack; class MidiTrack;
class MidiRegion; class MidiRegion;
class Region;
} }
class MidiRegionView; class MidiRegionView;

View File

@ -20,9 +20,11 @@
#pragma once #pragma once
#include "mixer_strip.h"
#include <list> #include <list>
class MixerStrip; class MixerStrip;
struct MixerStripSelection : list<MixerStrip*> {}; struct MixerStripSelection : std::list<MixerStrip*> {};

View File

@ -19,11 +19,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <glibmm/threads.h>
#include <gtkmm/progressbar.h>
#include <gtkmm/spinbutton.h> #include <gtkmm/spinbutton.h>
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include <pbd/xml++.h> #include <pbd/xml++.h>
#include "ardour/interthread_info.h"
#include "ardour/types.h" #include "ardour/types.h"
#include "ardour_dialog.h" #include "ardour_dialog.h"
#include "progress_reporter.h" #include "progress_reporter.h"

View File

@ -22,6 +22,8 @@
#include "canvas/flag.h" #include "canvas/flag.h"
#include "ardour/midi_model.h"
class MidiView; class MidiView;
class SysEx class SysEx

View File

@ -27,6 +27,7 @@
#include "ardour/ardour.h" #include "ardour/ardour.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "canvas/container.h"
#include "canvas/types.h" #include "canvas/types.h"
#include "canvas/framed_curve.h" #include "canvas/framed_curve.h"
#include "canvas/text.h" #include "canvas/text.h"

View File

@ -1,188 +0,0 @@
/*
* Copyright (C) 2007-2015 David Robillard <d@drobilla.net>
* Copyright (C) 2010-2017 Paul Davis <paul@linuxaudiosystems.com>
* Copyright (C) 2012 Carl Hetherington <carl@carlh.net>
* Copyright (C) 2014-2017 Nick Mainsbridge <mainsbridge@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "pbd/compose.h"
#include "canvas/canvas.h"
#include "canvas/debug.h"
#include "tempo_lines.h"
#include "public_editor.h"
#include "rgb_macros.h"
#include "ui_config.h"
using namespace std;
TempoLines::TempoLines (ArdourCanvas::Container* group, double, ARDOUR::BeatsSamplesConverter* bfc)
: lines (group, ArdourCanvas::LineSet::Vertical)
, _bfc (bfc)
{
lines.set_extent (ArdourCanvas::COORD_MAX);
}
TempoLines::~TempoLines ()
{
delete _bfc;
_bfc = 0;
}
void
TempoLines::tempo_map_changed (samplepos_t new_origin)
{
lines.clear ();
_bfc->set_origin_b (new_origin);
}
void
TempoLines::show ()
{
lines.show ();
}
void
TempoLines::hide ()
{
lines.hide ();
}
void
TempoLines::draw_ticks (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
unsigned divisions,
samplecnt_t leftmost_sample,
samplecnt_t sample_rate)
{
const uint32_t base = UIConfiguration::instance().color_mod("measure line beat", "measure line beat");
for (unsigned l = 1; l < divisions; ++l) {
/* find the coarsest division level this tick falls on */
unsigned level = divisions;
for (unsigned d = divisions; d >= 4; d /= 2) {
if (l % (divisions / d) == 0) {
level = d;
}
}
/* draw line with alpha corresponding to coarsest level */
const uint8_t a = max(8, (int)rint(UINT_RGBA_A(base) / (0.8 * log2(level))));
const uint32_t c = UINT_RGBA_CHANGE_A(base, a);
const samplepos_t f = _bfc->to (Temporal::Beats (grid.begin()->qn + (l / (double) divisions))) + _bfc->origin_b();
if (f > leftmost_sample) {
lines.add (PublicEditor::instance().sample_to_pixel_unrounded (f), 1.0, c);
}
}
}
void
TempoLines::draw (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
unsigned divisions,
samplecnt_t leftmost_sample,
samplecnt_t sample_rate)
{
std::vector<ARDOUR::TempoMap::BBTPoint>::const_iterator i;
double beat_density;
uint32_t beats = 0;
uint32_t bars = 0;
const uint32_t bar_color = UIConfiguration::instance().color ("measure line bar");
const uint32_t beat_color = UIConfiguration::instance().color_mod ("measure line beat", "measure line beat");
uint32_t color;
bool all_bars = false;
/* get the first bar spacing */
i = grid.end();
i--;
bars = (*i).bar - (*grid.begin()).bar;
int32_t bar_mod = 4;
if (bars < distance (grid.begin(), grid.end()) - 1) {
/* grid contains beats and bars */
beats = distance (grid.begin(), grid.end()) - bars;
} else {
/* grid contains only bars */
beats = distance (grid.begin(), grid.end());
if (i != grid.begin()) {
const int32_t last_bar = (*i).bar;
i--;
bar_mod = (last_bar - (*i).bar) * 4;
}
all_bars = true;
}
double canvas_width_used = 1.0;
if (leftmost_sample < grid.front().sample) {
const samplecnt_t sample_distance = max ((samplecnt_t) 1, grid.back().sample - grid.front().sample);
canvas_width_used = 1.0 - ((grid.front().sample - leftmost_sample) / (double) (sample_distance + grid.front().sample));
}
beat_density = (beats * 10.0f) / (lines.canvas()->width() * canvas_width_used);
if (beat_density > 2.0f) {
/* if the lines are too close together, they become useless */
lines.clear ();
return;
}
/* constrain divisions to a log2 factor to cap line density */
while (divisions > 3 && beat_density * divisions > 0.4) {
divisions /= 2;
}
lines.clear ();
if (beat_density <= 0.12 && grid.begin() != grid.end() && grid.begin()->sample > 0 && !all_bars) {
/* draw subdivisions of the beat before the first visible beat line XX this shouldn't happen now */
std::vector<ARDOUR::TempoMap::BBTPoint> vec;
vec.push_back (*i);
draw_ticks (vec, divisions, leftmost_sample, sample_rate);
}
for (i = grid.begin(); i != grid.end(); ++i) {
if ((*i).is_bar()) {
/* keep all_bar beat density down */
if (all_bars && beat_density > 0.3 && ((*i).bar % bar_mod) != 1) {
continue;
}
color = bar_color;
} else {
if (beat_density > 0.3) {
continue; /* only draw beat lines if the gaps between beats are large. */
}
color = beat_color;
}
ArdourCanvas::Coord xpos = PublicEditor::instance().sample_to_pixel_unrounded ((*i).sample);
lines.add (xpos, 1.0, color);
if (beat_density <= 0.12 && !all_bars) {
/* draw subdivisions of this beat */
std::vector<ARDOUR::TempoMap::BBTPoint> vec;
vec.push_back (*i);
draw_ticks (vec, divisions, leftmost_sample, sample_rate);
}
}
}

View File

@ -1,51 +0,0 @@
/*
* Copyright (C) 2007-2015 David Robillard <d@drobilla.net>
* Copyright (C) 2012-2017 Paul Davis <paul@linuxaudiosystems.com>
* Copyright (C) 2015-2017 Nick Mainsbridge <mainsbridge@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "ardour/tempo.h"
#include "canvas/line_set.h"
class TempoLines {
public:
TempoLines (ArdourCanvas::Container* group, double screen_height, ARDOUR::BeatsSamplesConverter* bfc);
~TempoLines ();
void tempo_map_changed(samplepos_t new_origin);
void draw (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
unsigned divisions,
ARDOUR::samplecnt_t leftmost_sample,
ARDOUR::samplecnt_t sample_rate);
void show();
void hide();
private:
void draw_ticks (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
unsigned divisions,
ARDOUR::samplecnt_t leftmost_sample,
ARDOUR::samplecnt_t sample_rate);
ArdourCanvas::LineSet lines;
ARDOUR::BeatsSamplesConverter* _bfc;
};

View File

@ -28,6 +28,7 @@
#include <gdk/gdk.h> #include <gdk/gdk.h>
#include <gdkmm/color.h> #include <gdkmm/color.h>
#include <pangomm/fontdescription.h> #include <pangomm/fontdescription.h>
#include "ardour/types.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "selectable.h" #include "selectable.h"

View File

@ -313,11 +313,7 @@ TimeInfoBox::selection_changed ()
case Editing::MouseRange: case Editing::MouseRange:
if (selection.time.empty()) { if (selection.time.empty()) {
/* XXX we really ought to be calling Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (PublicEditor::instance().editor_name().c_str(), "set-mouse-mode-object-range");
::get_mouse_mode_action() here but there is no actual
mouse emode enum for smart mode (object-range).
*/
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (PublicEditor::instance().editor_name(), "set-mouse-mode-object-range");
if (tact->get_active() && !selection.regions.empty()) { if (tact->get_active() && !selection.regions.empty()) {
/* show selected regions */ /* show selected regions */

View File

@ -25,6 +25,7 @@
#include <gtkmm/alignment.h> #include <gtkmm/alignment.h>
#include <gtkmm/box.h> #include <gtkmm/box.h>
#include <gtkmm/drawingarea.h> #include <gtkmm/drawingarea.h>
#include <gtkmm/entry.h>
#include <gtkmm/eventbox.h> #include <gtkmm/eventbox.h>
#include <gtkmm/separator.h> #include <gtkmm/separator.h>
#include <gtkmm/sizegroup.h> #include <gtkmm/sizegroup.h>

View File

@ -192,7 +192,7 @@ TranscodeFfmpeg::probe ()
PARSE_FRACTIONAL_FPS (timebase) PARSE_FRACTIONAL_FPS (timebase)
} else if (key == X_("timecode") && m_duration == 0 && m_fps > 0) { } else if (key == X_("timecode") && m_duration == 0 && m_fps > 0) {
int h, m, s; int h, m, s;
char f[32]; char f[33];
if (sscanf (i->at (16).c_str (), "%d:%d:%d:%32s", &h, &m, &s, f) == 4) { if (sscanf (i->at (16).c_str (), "%d:%d:%d:%32s", &h, &m, &s, f) == 4) {
m_duration = (ARDOUR::samplecnt_t)floor (m_fps * (h * 3600.0 + m * 60.0 + s * 1.0 + atoi (f) / pow ((double)10, (int)strlen (f)))); m_duration = (ARDOUR::samplecnt_t)floor (m_fps * (h * 3600.0 + m * 60.0 + s * 1.0 + atoi (f) / pow ((double)10, (int)strlen (f))));
} }

View File

@ -419,23 +419,7 @@ TriggerPage::rec_enable_changed (Trigger const * trigger)
_midi_trig_box.set_trigger (ref); _midi_trig_box.set_trigger (ref);
_midi_trig_box.show (); _midi_trig_box.show ();
_midi_editor->set_box (trigger->boxptr()); _midi_editor->set (ref);
Stripable* st = dynamic_cast<Stripable*> (box.owner());
assert (st);
std::shared_ptr<MidiTrack> mt = std::dynamic_pointer_cast<MidiTrack> (st->shared_from_this());
assert (mt);
_midi_editor->set_track (mt);
if (trigger->the_region()) {
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion> (trigger->the_region());
if (mr) {
_midi_editor->set_region (mr);
}
}
_midi_editor->viewport().show (); _midi_editor->viewport().show ();
} }
@ -475,19 +459,7 @@ TriggerPage::selection_changed ()
_midi_trig_box.set_trigger (ref); _midi_trig_box.set_trigger (ref);
_midi_trig_box.show (); _midi_trig_box.show ();
std::shared_ptr<MidiTrack> mt = std::dynamic_pointer_cast<MidiTrack> (entry->strip().stripable()); _midi_editor->set (ref);
assert (mt);
_midi_editor->set_track (mt);
if (trigger->the_region()) {
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion> (trigger->the_region());
if (mr) {
_midi_editor->set_region (mr);
}
}
_midi_editor->viewport().show (); _midi_editor->viewport().show ();
} }

View File

@ -31,6 +31,7 @@
#include "audio_region_operations_box.h" #include "audio_region_operations_box.h"
#include "audio_region_properties_box.h" #include "audio_region_properties_box.h"
#include "audio_trigger_properties_box.h" #include "audio_trigger_properties_box.h"
#include "axis_provider.h"
#include "cuebox_ui.h" #include "cuebox_ui.h"
#include "fitted_canvas_widget.h" #include "fitted_canvas_widget.h"
#include "midi_region_operations_box.h" #include "midi_region_operations_box.h"

View File

@ -797,7 +797,6 @@ TriggerUI::trigger_changed (PropertyChange const& what)
on_trigger_changed(what); on_trigger_changed(what);
} }
void void
TriggerUI::set_trigger (ARDOUR::TriggerReference tr) TriggerUI::set_trigger (ARDOUR::TriggerReference tr)
{ {

View File

@ -84,8 +84,8 @@ UIConfiguration::UIConfiguration ()
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#define UI_CONFIG_VARIABLE(Type,var,name,val) var (name,val), #define UI_CONFIG_VARIABLE(Type,var,name,val) var (name,val),
#define CANVAS_FONT_VARIABLE(var,name) var (name), #define CANVAS_FONT_VARIABLE(var,name) var (name),
#include "ui_config_vars.h" #include "ui_config_vars.inc.h"
#include "canvas_vars.h" #include "canvas_vars.inc.h"
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#undef CANVAS_FONT_VARIABLE #undef CANVAS_FONT_VARIABLE
@ -101,7 +101,7 @@ UIConfiguration::UIConfiguration ()
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#define UI_CONFIG_VARIABLE(Type,var,name,value) _my_variables.insert (std::make_pair ((name), &(var))); #define UI_CONFIG_VARIABLE(Type,var,name,value) _my_variables.insert (std::make_pair ((name), &(var)));
#define CANVAS_FONT_VARIABLE(var,name) /* no need for metadata for these */ #define CANVAS_FONT_VARIABLE(var,name) /* no need for metadata for these */
#include "ui_config_vars.h" #include "ui_config_vars.inc.h"
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#undef CANVAS_FONT_VARIABLE #undef CANVAS_FONT_VARIABLE
@ -222,7 +222,7 @@ UIConfiguration::map_parameters (std::function<void (std::string)>& functor)
{ {
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#define UI_CONFIG_VARIABLE(Type,var,Name,value) functor (Name); #define UI_CONFIG_VARIABLE(Type,var,Name,value) functor (Name);
#include "ui_config_vars.h" #include "ui_config_vars.inc.h"
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
} }
@ -572,8 +572,8 @@ UIConfiguration::get_variables (std::string const & node_name) const
#undef CANVAS_FONT_VARIABLE #undef CANVAS_FONT_VARIABLE
#define UI_CONFIG_VARIABLE(Type,var,Name,value) if (node->name() == "UI") { var.add_to_node (*node); } #define UI_CONFIG_VARIABLE(Type,var,Name,value) if (node->name() == "UI") { var.add_to_node (*node); }
#define CANVAS_FONT_VARIABLE(var,Name) if (node->name() == "Canvas") { var.add_to_node (*node); } #define CANVAS_FONT_VARIABLE(var,Name) if (node->name() == "Canvas") { var.add_to_node (*node); }
#include "ui_config_vars.h" #include "ui_config_vars.inc.h"
#include "canvas_vars.h" #include "canvas_vars.inc.h"
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#undef CANVAS_FONT_VARIABLE #undef CANVAS_FONT_VARIABLE
@ -707,8 +707,8 @@ UIConfiguration::set_variables (const XMLNode& node)
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#define UI_CONFIG_VARIABLE(Type,var,name,val) if (var.set_from_node (node)) { ParameterChanged (name); } #define UI_CONFIG_VARIABLE(Type,var,name,val) if (var.set_from_node (node)) { ParameterChanged (name); }
#define CANVAS_FONT_VARIABLE(var,name) if (var.set_from_node (node)) { ParameterChanged (name); } #define CANVAS_FONT_VARIABLE(var,name) if (var.set_from_node (node)) { ParameterChanged (name); }
#include "ui_config_vars.h" #include "ui_config_vars.inc.h"
#include "canvas_vars.h" #include "canvas_vars.inc.h"
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#undef CANVAS_FONT_VARIABLE #undef CANVAS_FONT_VARIABLE
} }
@ -867,4 +867,4 @@ UIConfiguration::color_to_hex_string_no_alpha (Gtkmm2ext::Color c)
return buf; return buf;
} }
#include "configuration_metadata.h" #include "configuration_metadata.inc.h"

View File

@ -114,13 +114,13 @@ public:
#define UI_CONFIG_VARIABLE(Type,var,name,value) \ #define UI_CONFIG_VARIABLE(Type,var,name,value) \
Type get_##var () const { return var.get(); } \ Type get_##var () const { return var.get(); } \
bool set_##var (Type val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; } bool set_##var (Type val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
#include "ui_config_vars.h" #include "ui_config_vars.inc.h"
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#define CANVAS_FONT_VARIABLE(var,name) \ #define CANVAS_FONT_VARIABLE(var,name) \
Pango::FontDescription get_##var () const { return ARDOUR_UI_UTILS::sanitized_font (var.get()); } \ Pango::FontDescription get_##var () const { return ARDOUR_UI_UTILS::sanitized_font (var.get()); } \
Pango::FontDescription get_Ardour##var () const { return ARDOUR_UI_UTILS::ardour_font (var.get()); } \ Pango::FontDescription get_Ardour##var () const { return ARDOUR_UI_UTILS::ardour_font (var.get()); } \
bool set_##var (const std::string& val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; } bool set_##var (const std::string& val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
#include "canvas_vars.h" #include "canvas_vars.inc.h"
#undef CANVAS_FONT_VARIABLE #undef CANVAS_FONT_VARIABLE
private: private:
@ -128,11 +128,11 @@ private:
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#define UI_CONFIG_VARIABLE(Type,var,name,value) PBD::ConfigVariable<Type> var; #define UI_CONFIG_VARIABLE(Type,var,name,value) PBD::ConfigVariable<Type> var;
#include "ui_config_vars.h" #include "ui_config_vars.inc.h"
#undef UI_CONFIG_VARIABLE #undef UI_CONFIG_VARIABLE
#define CANVAS_FONT_VARIABLE(var,name) PBD::ConfigVariable<std::string> var; #define CANVAS_FONT_VARIABLE(var,name) PBD::ConfigVariable<std::string> var;
#include "canvas_vars.h" #include "canvas_vars.inc.h"
#undef CANVAS_FONT_VARIABLE #undef CANVAS_FONT_VARIABLE
XMLNode& state () const; XMLNode& state () const;

View File

@ -203,12 +203,15 @@ VelocityDisplay::set_size_and_position (GhostEvent& gev)
void void
VelocityDisplay::update_note (NoteBase* nb) VelocityDisplay::update_note (NoteBase* nb)
{ {
GhostEvent* gev = GhostEvent::find (nb->note(), events, _optimization_iterator); auto iter = events.end();
GhostEvent* gev = GhostEvent::find (nb->note(), events, iter);
if (!gev) { if (!gev) {
return; return;
} }
_optimization_iterator = iter;
update_ghost_event (gev); update_ghost_event (gev);
} }
@ -319,7 +322,9 @@ VelocityDisplay::y_position_to_velocity (double y) const
void void
VelocityDisplay::note_selected (NoteBase* ev) VelocityDisplay::note_selected (NoteBase* ev)
{ {
GhostEvent* gev = GhostEvent::find (ev->note(), events, _optimization_iterator); auto ignore_optiter = events.end();
GhostEvent* gev = GhostEvent::find (ev->note(), events, ignore_optiter);
if (!gev) { if (!gev) {
return; return;
@ -430,3 +435,22 @@ VelocityDisplay::set_selected (bool yn)
base.parent()->raise_to_top (); base.parent()->raise_to_top ();
} }
} }
void
VelocityDisplay::hide ()
{
if (lolli_container) {
lolli_container->hide ();
lolli_container->set_ignore_events (true);
}
}
void
VelocityDisplay::show ()
{
if (lolli_container) {
lolli_container->show ();
lolli_container->set_ignore_events (false);
}
}

View File

@ -44,6 +44,9 @@ class VelocityDisplay
VelocityDisplay (EditingContext&, MidiViewBackground&, MidiView&, ArdourCanvas::Rectangle& base_rect, ArdourCanvas::Container&, GhostEvent::EventList& el, Gtkmm2ext::Color oc); VelocityDisplay (EditingContext&, MidiViewBackground&, MidiView&, ArdourCanvas::Rectangle& base_rect, ArdourCanvas::Container&, GhostEvent::EventList& el, Gtkmm2ext::Color oc);
virtual ~VelocityDisplay (); virtual ~VelocityDisplay ();
void hide ();
void show ();
void redisplay(); void redisplay();
void add_note(NoteBase*); void add_note(NoteBase*);

View File

@ -41,6 +41,7 @@ class ViewBackground
virtual ~ViewBackground (); virtual ~ViewBackground ();
virtual double height() const { return 0.; } virtual double height() const { return 0.; }
virtual double width() const { return 0.; }
virtual double contents_height() const { return 0.; } virtual double contents_height() const { return 0.; }
/** @return y position, or -1 if hidden */ /** @return y position, or -1 if hidden */

View File

@ -21,6 +21,8 @@
#define __ardour_visibility_group__ #define __ardour_visibility_group__
#include <gtkmm/liststore.h> #include <gtkmm/liststore.h>
#include <gtkmm/widget.h>
#include "pbd/signals.h" #include "pbd/signals.h"
class XMLNode; class XMLNode;

View File

@ -24,12 +24,16 @@
#include <string> #include <string>
#include <map> #include <map>
#include <glibmm/refptr.h>
#include <sigc++/trackable.h> #include <sigc++/trackable.h>
#include "gtkmm2ext/actions.h"
#include "gtkmm2ext/bindings.h" #include "gtkmm2ext/bindings.h"
#include "gtkmm2ext/window_proxy.h" #include "gtkmm2ext/window_proxy.h"
#include <glibmm/refptr.h>
#include "ardour/session_handle.h"
class XMLNode; class XMLNode;
namespace Gtk { namespace Gtk {

View File

@ -159,7 +159,7 @@ gtk2_ardour_sources = [
'main.cc', 'main.cc',
'main_clock.cc', 'main_clock.cc',
'marker.cc', 'marker.cc',
'mergeable_line.cc', 'mergeable_line.cc',
'midi_automation_line.cc', 'midi_automation_line.cc',
'midi_channel_dialog.cc', 'midi_channel_dialog.cc',
'midi_channel_selector.cc', 'midi_channel_selector.cc',
@ -772,6 +772,7 @@ def build(bld):
if sys.platform == 'darwin': if sys.platform == 'darwin':
basefont = "" basefont = ""
font_sizes = { font_sizes = {
'VERYSMALL' : '7',
'SMALLER' : '9', 'SMALLER' : '9',
'SMALL' : '10', 'SMALL' : '10',
'NORMAL' : '11', 'NORMAL' : '11',
@ -789,6 +790,7 @@ def build(bld):
else: # Linux/X11 & Windows fonts else: # Linux/X11 & Windows fonts
basefont = '' # unspecified - use system defaults basefont = '' # unspecified - use system defaults
font_sizes = { font_sizes = {
'VERYSMALL' : '8',
'SMALLER' : '6', 'SMALLER' : '6',
'SMALL' : '7', 'SMALL' : '7',
'NORMAL' : '8', 'NORMAL' : '8',
@ -971,26 +973,27 @@ def build(bld):
bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'), bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
mo) mo)
def i18n(bld): def i18n_func(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR'] I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
autowaf.build_i18n(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources, autowaf.build_i18n(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
'Paul Davis') 'Paul Davis')
appdata_i18n_pot(bld) appdata_i18n_pot(bld)
appdata_i18n_po(bld) appdata_i18n_po(bld)
appdata_i18n_mo(bld)
def i18n_pot(bld): def i18n_pot_func(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR'] I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
autowaf.build_i18n_pot(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources, autowaf.build_i18n_pot(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
'Paul Davis') 'Paul Davis')
appdata_i18n_pot(bld) appdata_i18n_pot(bld)
def i18n_po(bld): def i18n_po_func(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR'] I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
autowaf.build_i18n_po(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources, autowaf.build_i18n_po(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
'Paul Davis') 'Paul Davis')
appdata_i18n_po(bld) appdata_i18n_po(bld)
def i18n_mo(bld): def i18n_mo_func(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR'] I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
autowaf.build_i18n_mo(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources, autowaf.build_i18n_mo(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
'Paul Davis') 'Paul Davis')
@ -998,7 +1001,7 @@ def i18n_mo(bld):
def appdata_i18n_pot(bld): def appdata_i18n_pot(bld):
potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata', potfile = os.path.join(bld.top_dir, 'gtk2_ardour', 'appdata',
'ardour.appdata.pot') 'ardour.appdata.pot')
if bld.cmd == 'i18n_pot': if bld.cmd in ('i18n_pot', 'i18n'):
Logs.info('Generating pot file from Ardour appdata') Logs.info('Generating pot file from Ardour appdata')
itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its') itsfile = os.path.join(bld.top_dir, 'tools', 'as-metainfo.its')
adsource = os.path.join(bld.top_dir, 'gtk2_ardour', adsource = os.path.join(bld.top_dir, 'gtk2_ardour',

View File

@ -16,22 +16,22 @@ top = '.'
out = 'build' out = 'build'
libaaf_sources = [ libaaf_sources = [
'AAFClass.c', 'AAFClass.c',
'AAFCore.c', 'AAFCore.c',
'AAFDump.c', 'AAFDump.c',
'AAFIEssenceFile.c', 'AAFIEssenceFile.c',
'AAFIface.c', 'AAFIface.c',
'AAFIParser.c', 'AAFIParser.c',
'AAFToText.c', 'AAFToText.c',
'CFBDump.c', 'CFBDump.c',
'LibCFB.c', 'LibCFB.c',
'ProTools.c', 'ProTools.c',
'MediaComposer.c', 'MediaComposer.c',
'Resolve.c', 'Resolve.c',
'RIFFParser.c', 'RIFFParser.c',
'URIParser.c', 'URIParser.c',
'utils.c', 'utils.c',
'log.c', 'log.c',
] ]
def options(opt): def options(opt):

View File

@ -42,6 +42,3 @@ def build(bld):
obj.name = 'libappleutility' obj.name = 'libappleutility'
obj.target = 'appleutility' obj.target = 'appleutility'
obj.install_path = os.path.join(bld.env['LIBDIR'], 'appleutility') obj.install_path = os.path.join(bld.env['LIBDIR'], 'appleutility')
def i18n(bld):
pass

View File

@ -1881,10 +1881,6 @@
RelativePath="..\ardour\export_handler.h" RelativePath="..\ardour\export_handler.h"
> >
</File> </File>
<File
RelativePath="..\ardour\export_multiplication.h"
>
</File>
<File <File
RelativePath="..\ardour\export_pointers.h" RelativePath="..\ardour\export_pointers.h"
> >
@ -2350,7 +2346,7 @@
> >
</File> </File>
<File <File
RelativePath="..\ardour\rc_configuration_vars.h" RelativePath="..\ardour\rc_configuration_vars.inc.h"
> >
</File> </File>
<File <File
@ -2458,7 +2454,7 @@
> >
</File> </File>
<File <File
RelativePath="..\ardour\session_configuration_vars.h" RelativePath="..\ardour\session_configuration_vars.inc.h"
> >
</File> </File>
<File <File
@ -2545,10 +2541,6 @@
RelativePath="..\ardour\soundcloud_upload.h" RelativePath="..\ardour\soundcloud_upload.h"
> >
</File> </File>
<File
RelativePath="..\ardour\soundseq.h"
>
</File>
<File <File
RelativePath="..\ardour\source.h" RelativePath="..\ardour\source.h"
> >

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