Plugin windows change title when route title changes.

Mixer strip comments saved. (thanks brianahr!)
Removed unnecessary SConscript file.
Fixed CoreAudioSource compilation.


git-svn-id: svn://localhost/ardour2/trunk@1063 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Taybin Rutkin
2006-11-03 01:42:51 +00:00
parent bf9c767581
commit 1b2ecaee84
10 changed files with 82 additions and 112 deletions

View File

@@ -189,7 +189,7 @@ About::About ()
"under certain conditions; see the file COPYING for details.\n"));
set_name (X_("ardour"));
set_website (X_("http://ardour.org/"));
set_website_label (X_("visit http://www.ardour.org/"));
set_website_label (_("visit http://www.ardour.org/"));
set_version ((string_compose(_("%1\n(built from revision %2)"),
VERSIONSTRING,
gtk_ardour_revision)));

View File

@@ -759,6 +759,36 @@ MixerStrip::output_changed (IOChange change, void *src)
Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &MixerStrip::update_output_display));
}
void
MixerStrip::comment_editor_done_editing() {
string str = comment_area->get_buffer()->get_text();
if (_route->comment() != str) {
_route->set_comment (str, this);
switch (_width) {
case Wide:
if (! str.empty()) {
comment_button.set_label (_("*Comments*"));
} else {
comment_button.set_label (_("Comments"));
}
break;
case Narrow:
if (! str.empty()) {
comment_button.set_label (_("*Cmt*"));
} else {
comment_button.set_label (_("Cmt"));
}
break;
}
ARDOUR_UI::instance()->tooltips().set_tip (comment_button,
str.empty() ? _("Click to Add/Edit Comments") : str);
}
}
void
MixerStrip::comment_button_clicked ()
{
@@ -766,38 +796,13 @@ MixerStrip::comment_button_clicked ()
setup_comment_editor ();
}
int x, y, cw_width, cw_height;
int x, y, cw_width, cw_height;
if (comment_window->is_visible()) {
string str = comment_area->get_buffer()->get_text();
if (_route->comment() != str) {
_route->set_comment (str, this);
comment_window->hide ();
return;
}
switch (_width) {
case Wide:
if (! str.empty()) {
comment_button.set_label (_("*Comments*"));
} else {
comment_button.set_label (_("Comments"));
}
break;
case Narrow:
if (! str.empty()) {
comment_button.set_label (_("*Cmt*"));
} else {
comment_button.set_label (_("Cmt"));
}
break;
}
ARDOUR_UI::instance()->tooltips().set_tip (comment_button,
str.empty() ? _("Click to Add/Edit Comments") : str);
}
comment_window->hide ();
return;
}
comment_window->get_size (cw_width, cw_height);
comment_window->get_position(x, y);
comment_window->move(x, y - (cw_height / 2) - 45);
@@ -808,7 +813,6 @@ MixerStrip::comment_button_clicked ()
comment_window->show();
comment_window->present();
}
void
@@ -821,6 +825,7 @@ MixerStrip::setup_comment_editor ()
comment_window = new ArdourDialog (title, false);
comment_window->set_position (Gtk::WIN_POS_MOUSE);
comment_window->set_skip_taskbar_hint (true);
comment_window->signal_hide().connect (mem_fun(*this, &MixerStrip::comment_editor_done_editing));
comment_area = manage (new TextView());
comment_area->set_name ("MixerTrackCommentArea");

View File

@@ -153,6 +153,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
Gtk::TextView* comment_area;
Gtk::Button comment_button;
void comment_editor_done_editing();
void setup_comment_editor ();
void comment_button_clicked ();

View File

@@ -118,6 +118,7 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, bool scr
PluginUIWindow::~PluginUIWindow ()
{
}
bool
PluginUIWindow::on_key_press_event (GdkEventKey* event)
{

View File

@@ -1,51 +0,0 @@
# -*- python -*-
import os
import os.path
import glob
Import ('env gtkardour install_prefix intl_files')
potfiles_in = open('POTFILES.in', 'w')
intl_files.sort()
print "Generating POTFILES.in in gtk_ardour/po"
potfiles_in.write("""# This file was automatically generated by a configuration script.
# Contains a list of source files containing translatable
# strings sorted alphabetically.
[encoding: UTF-8]
""")
for f in intl_files[:]:
potfiles_in.write(f + '\n')
potfiles_in.close()
print "Updating pot file: "
domain = gtkardour['DOMAIN']
potfile = gtkardour['POTFILE']
poaction = env.Action('intltool-update -p -g=' + domain)
Execute(poaction)
# this should probably be merged with the i18n builder somehow
p_oze = [ os.path.basename (po) for po in glob.glob ('*.po') ]
languages = [ po.replace ('.po', '') for po in p_oze ]
m_oze = [ po.replace (".po", ".mo") for po in p_oze ]
for mo in m_oze[:]:
po = mo.replace (".mo", ".po")
env.Alias ('install', gtkardour.MoBuild (mo, [ po, potfile ]))
for lang in languages[:]:
modir = (os.path.join (install_prefix, 'share/locale/' + lang + '/LC_MESSAGES/'))
moname = domain + '.mo'
env.Alias('install', env.InstallAs (os.path.join (modir, moname), lang + '.mo'))
env.Alias ('tarball', env.Distribute (env['DISTTREE'],
[ 'SConscript', 'gtk_ardour.pot' ] +
glob.glob('*.po')))

View File

@@ -922,7 +922,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect)
if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) == 0) {
/* its a send */
/* it's a send */
if (!_session.engine().connected()) {
return;
@@ -953,7 +953,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect)
} else {
/* its an insert */
/* it's an insert */
boost::shared_ptr<PluginInsert> plugin_insert;
boost::shared_ptr<PortInsert> port_insert;
@@ -966,30 +966,19 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect)
PluginUIWindow *plugin_ui;
if (plugin_insert->get_gui() == 0) {
string title;
string maker = plugin_insert->plugin()->maker();
string::size_type email_pos;
if ((email_pos = maker.find_first_of ('<')) != string::npos) {
maker = maker.substr (0, email_pos - 1);
}
if (maker.length() > 32) {
maker = maker.substr (0, 32);
maker += " ...";
}
title = string_compose(_("ardour: %1: %2 (by %3)"), _route->name(), plugin_insert->name(), maker);
plugin_ui = new PluginUIWindow (plugin_insert);
if (_owner_is_mixer) {
ARDOUR_UI::instance()->the_mixer()->ensure_float (*plugin_ui);
} else {
ARDOUR_UI::instance()->the_editor().ensure_float (*plugin_ui);
}
plugin_ui->set_title (title);
plugin_ui->set_title (RedirectBox::generate_redirect_title (plugin_insert));
plugin_insert->set_gui (plugin_ui);
// change window title when route name is changed
_route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, plugin_insert));
} else {
plugin_ui = reinterpret_cast<PluginUIWindow *> (plugin_insert->get_gui());
@@ -1240,3 +1229,28 @@ RedirectBox::rb_edit ()
_current_redirect_box->for_selected_redirects (&RedirectBox::edit_redirect);
}
void
RedirectBox::route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::shared_ptr<PluginInsert> pi)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &RedirectBox::route_name_changed), src, plugin_ui, pi));
plugin_ui->set_title (RedirectBox::generate_redirect_title (pi));
}
string
RedirectBox::generate_redirect_title (boost::shared_ptr<PluginInsert> pi)
{
string maker = pi->plugin()->maker();
string::size_type email_pos;
if ((email_pos = maker.find_first_of ('<')) != string::npos) {
maker = maker.substr (0, email_pos - 1);
}
if (maker.length() > 32) {
maker = maker.substr (0, 32);
maker += " ...";
}
return string_compose(_("ardour: %1: %2 (by %3)"), _route->name(), pi->name(), maker);
}

View File

@@ -49,19 +49,20 @@
class MotionController;
class PluginSelector;
class PluginUIWindow;
class RouteRedirectSelection;
namespace ARDOUR {
class Connection;
class Insert;
class Plugin;
class PluginInsert;
class PortInsert;
class Route;
class Send;
class Insert;
class Session;
class PortInsert;
class Connection;
class Plugin;
}
class RedirectBox : public Gtk::HBox
{
public:
@@ -217,6 +218,9 @@ class RedirectBox : public Gtk::HBox
static void rb_activate_all ();
static void rb_deactivate_all ();
static void rb_edit ();
void route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::shared_ptr<ARDOUR::PluginInsert> pi);
std::string generate_redirect_title (boost::shared_ptr<ARDOUR::PluginInsert> pi);
};
#endif /* __ardour_gtk_redirect_box__ */

View File

@@ -14,7 +14,7 @@ ardour = env.Copy()
domain = 'libardour'
ardour.Append(DOMAIN = domain, MAJOR = 1, MINOR = 0, MICRO = 0)
ardour.Append(DOMAIN = domain, MAJOR = 2, MINOR = 0, MICRO = 0)
ardour.Append(CXXFLAGS = "-DPACKAGE=\\\"" + domain + "\\\"")
ardour.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
ardour.Append(PACKAGE = domain)

View File

@@ -1,6 +1,6 @@
/*
Copyright (C) 2006 Paul Davis
Written by Taybin Rutkin
Written by Taybin Rutkin
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

View File

@@ -84,10 +84,6 @@ CoreAudioSource::init (string idstr)
error << string_compose ("CoreAudioSource: %1 (%2)", cax.mOperation, name()) << endmsg;
throw failed_constructor ();
}
if (_build_peakfiles) {
_need_peakfile = true;
}
}
CoreAudioSource::~CoreAudioSource ()