making the names according to those guidelines

[git-p4: depot-paths = "//Abdaw/dev_main/tracks/": change = 456839]
This commit is contained in:
Valeriy Kamyshniy 2014-05-01 03:53:31 -05:00
parent f86d74a861
commit 9a37477ccd
6 changed files with 68 additions and 87 deletions

View file

@ -66,28 +66,28 @@ SessionDialog::SessionDialog (WM::Proxy<TracksControlPanel>& system_configuratio
const std::string& template_name,
bool cancel_not_quit)
: WavesDialog (_("session_dialog.xml"), true, false)
, quit_button (get_waves_button ("quit_button"))
, system_configuration_button (get_waves_button ("system_configuration_button"))
, new_session_button (get_waves_button ("new_session_button"))
, open_selected_button (get_waves_button ("open_selected_button"))
, open_saved_session_button (get_waves_button ("open_saved_session_button"))
, session_details_label(get_label("session_details_label"))
, new_only (require_new)
, _quit_button (named_children ().get_waves_button ("quit_button"))
, _system_configuration_button (named_children ().get_waves_button ("system_configuration_button"))
, _new_session_button (named_children ().get_waves_button ("new_session_button"))
, _open_selected_button (named_children ().get_waves_button ("open_selected_button"))
, _open_saved_session_button (named_children ().get_waves_button ("open_saved_session_button"))
, _session_details_label(named_children ().get_label("session_details_label"))
, _new_only (require_new)
, _provided_session_name (session_name)
, _provided_session_path (session_path)
, _existing_session_chooser_used (false)
, _system_configuration_dialog(system_configuration_dialog)
{
recent_session_button[0] = &get_waves_button ("recent_session_button_0");
recent_session_button[1] = &get_waves_button ("recent_session_button_1");
recent_session_button[2] = &get_waves_button ("recent_session_button_2");
recent_session_button[3] = &get_waves_button ("recent_session_button_3");
recent_session_button[4] = &get_waves_button ("recent_session_button_4");
recent_session_button[5] = &get_waves_button ("recent_session_button_5");
recent_session_button[6] = &get_waves_button ("recent_session_button_6");
recent_session_button[7] = &get_waves_button ("recent_session_button_7");
recent_session_button[8] = &get_waves_button ("recent_session_button_8");
recent_session_button[9] = &get_waves_button ("recent_session_button_9");
_recent_session_button[0] = &named_children ().get_waves_button ("recent_session_button_0");
_recent_session_button[1] = &named_children ().get_waves_button ("recent_session_button_1");
_recent_session_button[2] = &named_children ().get_waves_button ("recent_session_button_2");
_recent_session_button[3] = &named_children ().get_waves_button ("recent_session_button_3");
_recent_session_button[4] = &named_children ().get_waves_button ("recent_session_button_4");
_recent_session_button[5] = &named_children ().get_waves_button ("recent_session_button_5");
_recent_session_button[6] = &named_children ().get_waves_button ("recent_session_button_6");
_recent_session_button[7] = &named_children ().get_waves_button ("recent_session_button_7");
_recent_session_button[8] = &named_children ().get_waves_button ("recent_session_button_8");
_recent_session_button[9] = &named_children ().get_waves_button ("recent_session_button_9");
init();
}

View file

@ -61,13 +61,13 @@ class SessionDialog : public WavesDialog {
~SessionDialog ();
private:
WavesButton& quit_button;
WavesButton& new_session_button;
WavesButton& open_selected_button;
WavesButton& open_saved_session_button;
WavesButton& system_configuration_button;
WavesButton* recent_session_button[MAX_RECENT_SESSION_COUNTS];
Gtk::Label& session_details_label;
WavesButton& _quit_button;
WavesButton& _new_session_button;
WavesButton& _open_selected_button;
WavesButton& _open_saved_session_button;
WavesButton& _system_configuration_button;
WavesButton* _recent_session_button[MAX_RECENT_SESSION_COUNTS];
Gtk::Label& _session_details_label;
WM::Proxy<TracksControlPanel>& _system_configuration_dialog;
#include "session_dialog.logic.h"

View file

@ -70,20 +70,20 @@ void SessionDialog::init()
set_keep_above (true);
set_position (WIN_POS_CENTER);
open_selected_button.set_sensitive (false);
_open_selected_button.set_sensitive (false);
if (!_provided_session_name.empty() && !new_only) {
if (!_provided_session_name.empty() && !_new_only) {
response (RESPONSE_OK);
return;
}
open_selected_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_open_selected));
open_saved_session_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_open_saved_session));
quit_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_quit));
new_session_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_new_session));
system_configuration_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_system_configuration));
_open_selected_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_open_selected));
_open_saved_session_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_open_saved_session));
_quit_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_quit));
_new_session_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_new_session));
_system_configuration_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_system_configuration));
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
recent_session_button[i]->signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_recent_session ));
_recent_session_button[i]->signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_recent_session ));
}
redisplay_system_configuration ();
redisplay_recent_sessions();
@ -101,16 +101,16 @@ SessionDialog::session_name (bool& should_be_new)
{
should_be_new = false;
if (!_provided_session_name.empty() && !new_only) {
if (!_provided_session_name.empty() && !_new_only) {
return _provided_session_name;
}
/* Try recent session selection */
if (!selected_session_full_name.empty()) {
if (!_selected_session_full_name.empty()) {
should_be_new = (_selection_type == NewSession);
return should_be_new ? Glib::path_get_basename(selected_session_full_name) :
selected_session_full_name;
return should_be_new ? Glib::path_get_basename(_selected_session_full_name) :
_selected_session_full_name;
}
return "";
@ -119,11 +119,11 @@ SessionDialog::session_name (bool& should_be_new)
std::string
SessionDialog::session_folder ()
{
if (!selected_session_full_name.empty() ) {
if (Glib::file_test (selected_session_full_name, Glib::FILE_TEST_IS_REGULAR)) {
return Glib::path_get_dirname (selected_session_full_name);
if (!_selected_session_full_name.empty() ) {
if (Glib::file_test (_selected_session_full_name, Glib::FILE_TEST_IS_REGULAR)) {
return Glib::path_get_dirname (_selected_session_full_name);
}
return selected_session_full_name;
return _selected_session_full_name;
}
return "";
}
@ -142,9 +142,9 @@ SessionDialog::on_new_session (WavesButton*)
dialog.add_button("OK", Gtk::RESPONSE_OK);
if (dialog.run() == Gtk::RESPONSE_OK) {
selected_session_full_name = dialog.get_filename();
_selected_session_full_name = dialog.get_filename();
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
recent_session_button[i]->set_active(false);
_recent_session_button[i]->set_active(false);
}
hide();
_selection_type = NewSession;
@ -157,11 +157,11 @@ void SessionDialog::redisplay_system_configuration ()
// Temp solution:
TracksControlPanel* panel = dynamic_cast<TracksControlPanel*>(_system_configuration_dialog.get(false));
if (panel) {
session_details_label.set_text(string_compose (_("%1\n\n\n\n%2"),
_session_details_label.set_text(string_compose (_("%1\n\n\n\n%2"),
panel->get_device_name(),
panel->get_sample_rate()));
} else {
session_details_label.set_text("");
_session_details_label.set_text("");
}
}
@ -169,7 +169,7 @@ int
SessionDialog::redisplay_recent_sessions ()
{
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
recent_session_button[i]->set_sensitive(false);
_recent_session_button[i]->set_sensitive(false);
}
std::vector<std::string> session_directories;
@ -229,10 +229,10 @@ SessionDialog::redisplay_recent_sessions ()
continue;
}
recent_session_full_name[session_snapshot_count] = Glib::build_filename (dirname, state_file_names.front() + statefile_suffix);
recent_session_button[session_snapshot_count]->set_text(Glib::path_get_basename (dirname));
recent_session_button[session_snapshot_count]->set_sensitive(true);
ARDOUR_UI::instance()->set_tip(*recent_session_button[session_snapshot_count], recent_session_full_name[session_snapshot_count]);
_recent_session_full_name[session_snapshot_count] = Glib::build_filename (dirname, state_file_names.front() + statefile_suffix);
_recent_session_button[session_snapshot_count]->set_text(Glib::path_get_basename (dirname));
_recent_session_button[session_snapshot_count]->set_sensitive(true);
ARDOUR_UI::instance()->set_tip(*_recent_session_button[session_snapshot_count], _recent_session_full_name[session_snapshot_count]);
++session_snapshot_count;
}
@ -268,9 +268,9 @@ SessionDialog::on_open_saved_session (WavesButton*)
dialog.add_button("CANCEL", Gtk::RESPONSE_CANCEL);
dialog.add_button("OK", Gtk::RESPONSE_OK);
if (dialog.run() == Gtk::RESPONSE_OK) {
selected_session_full_name = dialog.get_filename();
_selected_session_full_name = dialog.get_filename();
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
recent_session_button[i]->set_active(false);
_recent_session_button[i]->set_active(false);
}
_selection_type = SavedSession;
hide();
@ -285,20 +285,20 @@ SessionDialog::on_recent_session (WavesButton* clicked_button)
return;
}
else {
selected_session_full_name = "";
_selected_session_full_name = "";
_selection_type = Nothing;
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
if (recent_session_button[i] == clicked_button) {
selected_session_full_name = recent_session_full_name[i];
recent_session_button[i]->set_active(true);
if (_recent_session_button[i] == clicked_button) {
_selected_session_full_name = _recent_session_full_name[i];
_recent_session_button[i]->set_active(true);
} else {
recent_session_button[i]->set_active(false);
_recent_session_button[i]->set_active(false);
_selection_type = RecentSession;
}
}
}
open_selected_button.set_sensitive (_selection_type == RecentSession);
_open_selected_button.set_sensitive (_selection_type == RecentSession);
}
void

View file

@ -60,15 +60,15 @@
};
// attributes & control data
bool new_only;
bool _new_only;
std::string _provided_session_name;
std::string _provided_session_path;
std::string recent_session_full_name[MAX_RECENT_SESSION_COUNTS];
std::string selected_session_full_name;
std::string _recent_session_full_name[MAX_RECENT_SESSION_COUNTS];
std::string _selected_session_full_name;
bool _existing_session_chooser_used; ///< set to true when the existing session chooser has been used
Gtk::Label info_scroller_label;
std::string::size_type info_scroller_count;
sigc::connection info_scroller_connection;
Gtk::Label _info_scroller_label;
std::string::size_type _info_scroller_count;
sigc::connection _info_scroller_connection;
// methods
virtual void init();

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2014 Valeriy Kamyshniy
Copyright (C) 2014 Waves Audio Ltd.
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
@ -28,27 +28,8 @@
#include <gtkmm/filechooser.h>
//#include "pbd/failed_constructor.h"
//#include "pbd/file_utils.h"
//#include "pbd/replace_all.h"
//#include "pbd/whitespace.h"
//#include "pbd/stacktrace.h"
//#include "pbd/openuri.h"
//
//#include "ardour/audioengine.h"
//#include "ardour/filesystem_paths.h"
//#include "ardour/recent_sessions.h"
//#include "ardour/session.h"
//#include "ardour/session_state_utils.h"
//#include "ardour/template_utils.h"
//#include "ardour/filename_extensions.h"
//
//#include "ardour_ui.h"
#include "session_lock_dialog.h"
//#include "opts.h"
//VKPRefs:#include "engine_dialog.h"
#include "i18n.h"
//#include "utils.h"
using namespace std;
using namespace Gtk;
@ -62,12 +43,12 @@ using namespace ARDOUR;
SessionLockDialog::SessionLockDialog ()
: WavesDialog (_("session_lock_dialog.xml"), true, false)
, ok_button (get_waves_button ("ok_button"))
, _ok_button (named_children ().get_waves_button ("ok_button"))
{
set_keep_above (true);
set_position (WIN_POS_CENTER);
ok_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionLockDialog::on_ok));
_ok_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionLockDialog::on_ok));
}
SessionLockDialog::~SessionLockDialog()

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2014 Valeriy Kamyshniy
Copyright (C) 2014 Waves Audio Ltd.
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
@ -51,7 +51,7 @@ class SessionLockDialog : public WavesDialog {
~SessionLockDialog ();
private:
WavesButton& ok_button;
WavesButton& _ok_button;
void on_ok(WavesButton*);
};