mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 13:46:30 +01:00
audun's waveview outline patch; some diskstream fixes; real splash screen; more reorganization of new session dialog use; about is not marked as a splashscreen anymore (help out KDE users)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2935 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
03d2616dbc
commit
574db5d874
22 changed files with 926 additions and 441 deletions
|
|
@ -211,6 +211,7 @@ route_ui.cc
|
|||
selection.cc
|
||||
sfdb_ui.cc
|
||||
send_ui.cc
|
||||
splash.cc
|
||||
streamview.cc
|
||||
audio_streamview.cc
|
||||
tape_region_view.cc
|
||||
|
|
|
|||
|
|
@ -153,6 +153,8 @@ static const char* authors[] = {
|
|||
N_("Nedko Arnaudov"),
|
||||
N_("Carl Hetherington"),
|
||||
N_("Colin Fletcher"),
|
||||
N_("Roland Stigge"),
|
||||
N_("Audun Halland"),
|
||||
0
|
||||
};
|
||||
|
||||
|
|
@ -175,7 +177,7 @@ About::About ()
|
|||
: paypal_pixmap (paypal_xpm)
|
||||
#endif
|
||||
{
|
||||
set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
|
||||
// set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
|
||||
|
||||
string path;
|
||||
string t;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Ardour>
|
||||
<Canvas>
|
||||
<Option name="waveform" value="000000cc"/>
|
||||
<Option name="waveform" value="373737a7"/>
|
||||
<Option name="waveform fill" value="73737378"/>
|
||||
<Option name="clipped waveform" value="ff0000e5"/>
|
||||
<Option name="region base" value="bfbfc1aa"/>
|
||||
<Option name="selected region base" value="b591a8ff"/>
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@
|
|||
#include "add_route_dialog.h"
|
||||
#include "new_session_dialog.h"
|
||||
#include "about.h"
|
||||
#include "splash.h"
|
||||
#include "utils.h"
|
||||
#include "gui_thread.h"
|
||||
#include "theme_manager.h"
|
||||
|
|
@ -166,6 +167,12 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
|||
}
|
||||
|
||||
about = 0;
|
||||
splash = 0;
|
||||
|
||||
if (ARDOUR_COMMAND_LINE::session_name.length()) {
|
||||
/* only show this if we're not going to post the new session dialog */
|
||||
show_splash ();
|
||||
}
|
||||
|
||||
if (theArdourUI == 0) {
|
||||
theArdourUI = this;
|
||||
|
|
@ -261,6 +268,13 @@ ARDOUR_UI::create_engine ()
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// OS X where everything is sllloooowwww
|
||||
loading_dialog->set_message (_("Starting audio engine"));
|
||||
loading_dialog->show_all ();
|
||||
flush_pending ();
|
||||
#endif
|
||||
|
||||
try {
|
||||
engine = new ARDOUR::AudioEngine (ARDOUR_COMMAND_LINE::jack_client_name);
|
||||
|
||||
|
|
@ -592,74 +606,39 @@ Please consider the possibilities, and perhaps (re)start JACK."));
|
|||
win.show_all ();
|
||||
win.set_position (Gtk::WIN_POS_CENTER);
|
||||
|
||||
if (!ARDOUR_COMMAND_LINE::no_splash) {
|
||||
hide_splash ();
|
||||
}
|
||||
hide_splash ();
|
||||
|
||||
/* we just don't care about the result, but we want to block */
|
||||
|
||||
win.run ();
|
||||
}
|
||||
|
||||
static bool
|
||||
_hide_splash (gpointer arg)
|
||||
{
|
||||
((ARDOUR_UI*)arg)->hide_splash();
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::startup ()
|
||||
{
|
||||
string name, path;
|
||||
bool isnew;
|
||||
|
||||
new_session_dialog = new NewSessionDialog();
|
||||
|
||||
/* If no session name is given: we're not loading a session yet, nor creating a new one */
|
||||
// in 4 seconds, hide the splash screen
|
||||
|
||||
if (ARDOUR_COMMAND_LINE::session_name.length()) {
|
||||
Glib::signal_timeout().connect (bind (sigc::ptr_fun (_hide_splash), this), 4000);
|
||||
|
||||
/* Load session or start the new session dialog */
|
||||
|
||||
if (Session::find_session (ARDOUR_COMMAND_LINE::session_name, path, name, isnew)) {
|
||||
|
||||
MessageDialog msg (string_compose(_("Could not find command line session \"%1\""),
|
||||
ARDOUR_COMMAND_LINE::session_name),
|
||||
true,
|
||||
Gtk::MESSAGE_ERROR,
|
||||
Gtk::BUTTONS_OK);
|
||||
|
||||
msg.set_position (Gtk::WIN_POS_MOUSE);
|
||||
msg.present ();
|
||||
msg.run ();
|
||||
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (!ARDOUR_COMMAND_LINE::new_session) {
|
||||
|
||||
/* Supposed to be loading an existing session, but the session doesn't exist */
|
||||
|
||||
if (isnew) {
|
||||
MessageDialog msg (string_compose (_("\n\nNo session named \"%1\" exists.\n"
|
||||
"To create it from the command line, start ardour as:\n ardour --new %1"), path),
|
||||
true,
|
||||
Gtk::MESSAGE_ERROR,
|
||||
Gtk::BUTTONS_OK);
|
||||
|
||||
msg.set_position (Gtk::WIN_POS_MOUSE);
|
||||
msg.present ();
|
||||
msg.run ();
|
||||
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hide_splash ();
|
||||
|
||||
bool have_backend = EngineControl::engine_running();
|
||||
bool backend_audio_is_running = EngineControl::engine_running();
|
||||
XMLNode* audio_setup = Config->extra_xml ("AudioSetup");
|
||||
|
||||
if (audio_setup) {
|
||||
new_session_dialog->engine_control.set_state (*audio_setup);
|
||||
}
|
||||
|
||||
if (!get_session_parameters (ARDOUR_COMMAND_LINE::session_name, have_backend, ARDOUR_COMMAND_LINE::new_session)) {
|
||||
if (!get_session_parameters (backend_audio_is_running, ARDOUR_COMMAND_LINE::new_session)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2029,8 +2008,175 @@ ARDOUR_UI::fontconfig_dialog ()
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::parse_cmdline_path (const Glib::ustring& cmdline_path, Glib::ustring& session_name, Glib::ustring& session_path, bool& existing_session)
|
||||
{
|
||||
existing_session = false;
|
||||
|
||||
if (Glib::file_test (cmdline_path, Glib::FILE_TEST_IS_DIR)) {
|
||||
session_path = cmdline_path;
|
||||
existing_session = true;
|
||||
} else if (Glib::file_test (cmdline_path, Glib::FILE_TEST_IS_REGULAR)) {
|
||||
session_path = Glib::path_get_dirname (string (cmdline_path));
|
||||
existing_session = true;
|
||||
} else {
|
||||
/* it doesn't exist, assume the best */
|
||||
session_path = Glib::path_get_dirname (string (cmdline_path));
|
||||
}
|
||||
|
||||
session_name = basename_nosuffix (string (cmdline_path));
|
||||
}
|
||||
|
||||
int
|
||||
ARDOUR_UI::load_cmdline_session (const Glib::ustring& session_name, const Glib::ustring& session_path, bool& existing_session)
|
||||
{
|
||||
/* when this is called, the backend audio system must be running */
|
||||
|
||||
/* the main idea here is to deal with the fact that a cmdline argument for the session
|
||||
can be interpreted in different ways - it could be a directory or a file, and before
|
||||
we load, we need to know both the session directory and the snapshot (statefile) within it
|
||||
that we are supposed to use.
|
||||
*/
|
||||
|
||||
if (session_name.length() == 0 || session_path.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Glib::file_test (session_path, Glib::FILE_TEST_IS_DIR)) {
|
||||
|
||||
Glib::ustring predicted_session_file;
|
||||
|
||||
predicted_session_file = session_path;
|
||||
predicted_session_file += '/';
|
||||
predicted_session_file += session_name;
|
||||
predicted_session_file += Session::statefile_suffix();
|
||||
|
||||
if (Glib::file_test (predicted_session_file, Glib::FILE_TEST_EXISTS)) {
|
||||
existing_session = true;
|
||||
}
|
||||
|
||||
} else if (Glib::file_test (session_path, Glib::FILE_TEST_EXISTS)) {
|
||||
|
||||
if (session_path.find (Session::statefile_suffix()) == session_path.length() - 7) {
|
||||
/* existing .ardour file */
|
||||
existing_session = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
existing_session = false;
|
||||
}
|
||||
|
||||
/* lets just try to load it */
|
||||
|
||||
if (create_engine ()) {
|
||||
hide_splash ();
|
||||
loading_dialog->hide ();
|
||||
backend_audio_error (false, new_session_dialog);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return load_session (session_path, session_name);
|
||||
}
|
||||
|
||||
bool
|
||||
ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_engine, bool should_be_new)
|
||||
ARDOUR_UI::ask_about_loading_existing_session (const Glib::ustring& session_path)
|
||||
{
|
||||
Glib::ustring str = string_compose (_("This session\n%1\nalready exists. Do you want to open it?"), session_path);
|
||||
|
||||
MessageDialog msg (str,
|
||||
false,
|
||||
Gtk::MESSAGE_WARNING,
|
||||
Gtk::BUTTONS_YES_NO,
|
||||
true);
|
||||
|
||||
|
||||
msg.set_name (X_("CleanupDialog"));
|
||||
msg.set_wmclass (X_("existing_session"), "Ardour");
|
||||
msg.set_position (Gtk::WIN_POS_MOUSE);
|
||||
|
||||
switch (msg.run()) {
|
||||
case RESPONSE_YES:
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int
|
||||
ARDOUR_UI::build_session_from_nsd (const Glib::ustring& session_path, const Glib::ustring& session_name)
|
||||
{
|
||||
|
||||
uint32_t cchns;
|
||||
uint32_t mchns;
|
||||
AutoConnectOption iconnect;
|
||||
AutoConnectOption oconnect;
|
||||
uint32_t nphysin;
|
||||
uint32_t nphysout;
|
||||
|
||||
if (Profile->get_sae()) {
|
||||
|
||||
cchns = 0;
|
||||
mchns = 2;
|
||||
iconnect = AutoConnectPhysical;
|
||||
oconnect = AutoConnectMaster;
|
||||
nphysin = 0; // use all available
|
||||
nphysout = 0; // use all available
|
||||
|
||||
} else {
|
||||
|
||||
/* get settings from advanced section of NSD */
|
||||
|
||||
if (new_session_dialog->create_control_bus()) {
|
||||
cchns = (uint32_t) new_session_dialog->control_channel_count();
|
||||
} else {
|
||||
cchns = 0;
|
||||
}
|
||||
|
||||
if (new_session_dialog->create_master_bus()) {
|
||||
mchns = (uint32_t) new_session_dialog->master_channel_count();
|
||||
} else {
|
||||
mchns = 0;
|
||||
}
|
||||
|
||||
if (new_session_dialog->connect_inputs()) {
|
||||
iconnect = AutoConnectPhysical;
|
||||
} else {
|
||||
iconnect = AutoConnectOption (0);
|
||||
}
|
||||
|
||||
/// @todo some minor tweaks.
|
||||
|
||||
if (new_session_dialog->connect_outs_to_master()) {
|
||||
oconnect = AutoConnectMaster;
|
||||
} else if (new_session_dialog->connect_outs_to_physical()) {
|
||||
oconnect = AutoConnectPhysical;
|
||||
} else {
|
||||
oconnect = AutoConnectOption (0);
|
||||
}
|
||||
|
||||
nphysin = (uint32_t) new_session_dialog->input_limit_count();
|
||||
nphysout = (uint32_t) new_session_dialog->output_limit_count();
|
||||
}
|
||||
|
||||
if (build_session (session_path,
|
||||
session_name,
|
||||
cchns,
|
||||
mchns,
|
||||
iconnect,
|
||||
oconnect,
|
||||
nphysin,
|
||||
nphysout,
|
||||
engine->frame_rate() * 60 * 5)) {
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be_new)
|
||||
{
|
||||
bool existing_session = false;
|
||||
Glib::ustring session_name;
|
||||
|
|
@ -2045,91 +2191,45 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
|
|||
Gtk::BUTTONS_NONE);
|
||||
}
|
||||
|
||||
|
||||
int response = Gtk::RESPONSE_NONE;
|
||||
|
||||
if (predetermined_path.length()) {
|
||||
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
|
||||
|
||||
/* before we start, lets see if the given path looks like
|
||||
an existing ardour session. if it does, skip the
|
||||
tabs that we don't need
|
||||
*/
|
||||
parse_cmdline_path (ARDOUR_COMMAND_LINE::session_name, session_name, session_path, existing_session);
|
||||
|
||||
if (Glib::file_test (predetermined_path, Glib::FILE_TEST_IS_DIR)) {
|
||||
session_path = predetermined_path;
|
||||
existing_session = true;
|
||||
} else if (Glib::file_test (predetermined_path, Glib::FILE_TEST_IS_REGULAR)) {
|
||||
session_path = Glib::path_get_dirname (string (predetermined_path));
|
||||
existing_session = true;
|
||||
} else {
|
||||
/* it doesn't exist, assume the best */
|
||||
session_path = Glib::path_get_dirname (string (predetermined_path));
|
||||
/* don't ever reuse this */
|
||||
|
||||
ARDOUR_COMMAND_LINE::session_name = string();
|
||||
|
||||
if (existing_session && backend_audio_is_running) {
|
||||
|
||||
/* just load the thing already */
|
||||
|
||||
if (load_cmdline_session (session_name, session_path, existing_session) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
session_name = basename_nosuffix (string (predetermined_path));
|
||||
/* make the NSD use whatever information we have */
|
||||
|
||||
new_session_dialog->set_session_name (session_name);
|
||||
new_session_dialog->set_session_folder (session_path);
|
||||
new_session_dialog->set_modal (true);
|
||||
|
||||
if (existing_session) {
|
||||
|
||||
if (session_name.length() == 0 || session_path.length() == 0) {
|
||||
error << string_compose (_("Ardour cannot understand \"%1\" as a session name"), predetermined_path) << endmsg;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Glib::file_test (predetermined_path, Glib::FILE_TEST_IS_DIR)) {
|
||||
Glib::ustring predicted_session_file;
|
||||
|
||||
predicted_session_file = predetermined_path;
|
||||
predicted_session_file += '/';
|
||||
predicted_session_file += session_name;
|
||||
predicted_session_file += Session::statefile_suffix();
|
||||
|
||||
if (Glib::file_test (predicted_session_file, Glib::FILE_TEST_EXISTS)) {
|
||||
existing_session = true;
|
||||
}
|
||||
|
||||
} else if (Glib::file_test (predetermined_path, Glib::FILE_TEST_EXISTS)) {
|
||||
|
||||
if (predetermined_path.find (Session::statefile_suffix()) == predetermined_path.length() - 7) {
|
||||
/* existing .ardour file */
|
||||
existing_session = true;
|
||||
}
|
||||
} else {
|
||||
existing_session = false;
|
||||
}
|
||||
|
||||
if (existing_session && have_engine) {
|
||||
/* lets just try to load it */
|
||||
|
||||
loading_dialog->set_message (_("Starting audio engine"));
|
||||
loading_dialog->show_all ();
|
||||
flush_pending ();
|
||||
|
||||
if (create_engine ()) {
|
||||
backend_audio_error (!have_engine, new_session_dialog);
|
||||
loading_dialog->hide ();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (load_session (session_path, session_name) == 0) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* loading failed, or we need the NSD for something */
|
||||
|
||||
new_session_dialog->set_modal (false);
|
||||
new_session_dialog->set_position (WIN_POS_CENTER);
|
||||
new_session_dialog->set_current_page (0);
|
||||
new_session_dialog->set_existing_session (existing_session);
|
||||
new_session_dialog->reset_recent();
|
||||
|
||||
/* get this out of the way */
|
||||
|
||||
hide_splash ();
|
||||
|
||||
do {
|
||||
new_session_dialog->set_have_engine (have_engine);
|
||||
new_session_dialog->set_have_engine (backend_audio_is_running);
|
||||
new_session_dialog->present ();
|
||||
response = new_session_dialog->run ();
|
||||
loading_dialog->hide ();
|
||||
|
|
@ -2138,81 +2238,46 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
|
|||
|
||||
/* handle possible negative responses */
|
||||
|
||||
if (response == Gtk::RESPONSE_CANCEL || response == Gtk::RESPONSE_DELETE_EVENT) {
|
||||
|
||||
switch (response) {
|
||||
case Gtk::RESPONSE_CANCEL:
|
||||
case Gtk::RESPONSE_DELETE_EVENT:
|
||||
if (!session) {
|
||||
quit();
|
||||
}
|
||||
new_session_dialog->hide ();
|
||||
return false;
|
||||
|
||||
} else if (response == Gtk::RESPONSE_NONE) {
|
||||
case Gtk::RESPONSE_NONE:
|
||||
/* "Clear" was pressed */
|
||||
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
fontconfig_dialog();
|
||||
|
||||
/* if we're here to help set up audio parameters this is where want to do that.
|
||||
*/
|
||||
|
||||
if (!have_engine) {
|
||||
if (!backend_audio_is_running) {
|
||||
if (new_session_dialog->engine_control.setup_engine ()) {
|
||||
new_session_dialog->hide ();
|
||||
return false;
|
||||
}
|
||||
|
||||
loading_dialog->set_message (_("Starting audio engine"));
|
||||
loading_dialog->show_all ();
|
||||
flush_pending ();
|
||||
}
|
||||
|
||||
if (create_engine ()) {
|
||||
backend_audio_error (!have_engine, new_session_dialog);
|
||||
|
||||
backend_audio_error (!backend_audio_is_running, new_session_dialog);
|
||||
loading_dialog->hide ();
|
||||
flush_pending ();
|
||||
/* audio setup page */
|
||||
|
||||
new_session_dialog->set_existing_session (false);
|
||||
new_session_dialog->set_current_page (2);
|
||||
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
loading_dialog->hide ();
|
||||
have_engine = true;
|
||||
backend_audio_is_running = true;
|
||||
|
||||
/* now handle possible affirmative responses */
|
||||
|
||||
if (response == Gtk::RESPONSE_YES) {
|
||||
|
||||
/* YES == OPEN from the session selector */
|
||||
|
||||
session_name = new_session_dialog->session_name();
|
||||
|
||||
if (session_name.empty()) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
if (session_name[0] == '/' ||
|
||||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
|
||||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
|
||||
if (load_session (Glib::path_get_dirname (session_name), session_name)) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
} else {
|
||||
session_path = new_session_dialog->session_folder();
|
||||
if (load_session (session_path, session_name)) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (response == Gtk::RESPONSE_OK) {
|
||||
|
||||
/* OK == OPEN button */
|
||||
if (response == Gtk::RESPONSE_OK) {
|
||||
|
||||
session_name = new_session_dialog->session_name();
|
||||
|
||||
|
|
@ -2221,95 +2286,45 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
|
|||
goto try_again;
|
||||
}
|
||||
|
||||
/* if the user mistakenly typed path information into the session filename entry,
|
||||
convert what they typed into a path & a name
|
||||
*/
|
||||
|
||||
if (session_name[0] == '/' ||
|
||||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
|
||||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
|
||||
|
||||
session_path = Glib::path_get_dirname (session_name);
|
||||
session_name = Glib::path_get_basename (session_name);
|
||||
|
||||
} else {
|
||||
|
||||
session_path = new_session_dialog->session_folder();
|
||||
}
|
||||
|
||||
switch (new_session_dialog->which_page()) {
|
||||
|
||||
case NewSessionDialog::OpenPage:
|
||||
case NewSessionDialog::EnginePage:
|
||||
|
||||
if (session_name[0] == '/' ||
|
||||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
|
||||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
|
||||
|
||||
if (load_session (Glib::path_get_dirname (session_name), session_name)) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
} else {
|
||||
session_path = new_session_dialog->session_folder();
|
||||
if (load_session (session_path, session_name)) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
}
|
||||
goto loadit;
|
||||
break;
|
||||
|
||||
case NewSessionDialog::NewPage: /* nominally the "new" session creator, but could be in use for an old session */
|
||||
|
||||
if (new_session_dialog->get_current_page() == 0 && ARDOUR_COMMAND_LINE::session_name.empty()) {
|
||||
should_be_new = true;
|
||||
}
|
||||
|
||||
/* handle what appear to be paths rather than just a name */
|
||||
|
||||
if (session_name[0] == '/' ||
|
||||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
|
||||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
|
||||
|
||||
session_path = Glib::path_get_dirname (session_name);
|
||||
session_name = Glib::path_get_basename (session_name);
|
||||
|
||||
} else {
|
||||
|
||||
session_path = new_session_dialog->session_folder();
|
||||
|
||||
}
|
||||
should_be_new = true;
|
||||
|
||||
//XXX This is needed because session constructor wants a
|
||||
//non-existant path. hopefully this will be fixed at some point.
|
||||
|
||||
session_path = Glib::build_filename (session_path, session_name);
|
||||
|
||||
if (!should_be_new) {
|
||||
if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
|
||||
|
||||
if (load_session (session_path, session_name)) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
continue; /* leaves while() loop because response != NONE */
|
||||
|
||||
} else if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
|
||||
|
||||
Glib::ustring str = string_compose (_("This session\n%1\nalready exists. Do you want to open it?"), session_path);
|
||||
|
||||
MessageDialog msg (str,
|
||||
false,
|
||||
Gtk::MESSAGE_WARNING,
|
||||
Gtk::BUTTONS_YES_NO,
|
||||
true);
|
||||
|
||||
|
||||
msg.set_name (X_("CleanupDialog"));
|
||||
msg.set_wmclass (X_("existing_session"), "Ardour");
|
||||
msg.set_position (Gtk::WIN_POS_MOUSE);
|
||||
|
||||
switch (msg.run()) {
|
||||
case RESPONSE_YES:
|
||||
new_session_dialog->hide ();
|
||||
goto_editor_window ();
|
||||
flush_pending ();
|
||||
if (load_session (session_path, session_name)) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
goto done;
|
||||
break;
|
||||
default:
|
||||
if (ask_about_loading_existing_session (session_path)) {
|
||||
goto loadit;
|
||||
} else {
|
||||
response = RESPONSE_NONE;
|
||||
new_session_dialog->reset ();
|
||||
new_session_dialog->set_existing_session (false);
|
||||
loading_dialog->hide ();
|
||||
continue;
|
||||
goto try_again;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2318,101 +2333,35 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
|
|||
if (new_session_dialog->use_session_template()) {
|
||||
|
||||
template_name = new_session_dialog->session_template_name();
|
||||
|
||||
new_session_dialog->hide ();
|
||||
goto_editor_window ();
|
||||
flush_pending ();
|
||||
|
||||
if (load_session (session_path, session_name, template_name)) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
goto loadit;
|
||||
|
||||
} else {
|
||||
|
||||
uint32_t cchns;
|
||||
uint32_t mchns;
|
||||
AutoConnectOption iconnect;
|
||||
AutoConnectOption oconnect;
|
||||
uint32_t nphysin;
|
||||
uint32_t nphysout;
|
||||
|
||||
if (Profile->get_sae()) {
|
||||
|
||||
cchns = 0;
|
||||
mchns = 2;
|
||||
iconnect = AutoConnectPhysical;
|
||||
oconnect = AutoConnectMaster;
|
||||
nphysin = 0; // use all available
|
||||
nphysout = 0; // use all available
|
||||
|
||||
} else {
|
||||
|
||||
/* get settings from advanced section of NSD */
|
||||
|
||||
if (new_session_dialog->create_control_bus()) {
|
||||
cchns = (uint32_t) new_session_dialog->control_channel_count();
|
||||
} else {
|
||||
cchns = 0;
|
||||
}
|
||||
|
||||
if (new_session_dialog->create_master_bus()) {
|
||||
mchns = (uint32_t) new_session_dialog->master_channel_count();
|
||||
} else {
|
||||
mchns = 0;
|
||||
}
|
||||
|
||||
if (new_session_dialog->connect_inputs()) {
|
||||
iconnect = AutoConnectPhysical;
|
||||
} else {
|
||||
iconnect = AutoConnectOption (0);
|
||||
}
|
||||
|
||||
/// @todo some minor tweaks.
|
||||
|
||||
if (new_session_dialog->connect_outs_to_master()) {
|
||||
oconnect = AutoConnectMaster;
|
||||
} else if (new_session_dialog->connect_outs_to_physical()) {
|
||||
oconnect = AutoConnectPhysical;
|
||||
} else {
|
||||
oconnect = AutoConnectOption (0);
|
||||
}
|
||||
|
||||
nphysin = (uint32_t) new_session_dialog->input_limit_count();
|
||||
nphysout = (uint32_t) new_session_dialog->output_limit_count();
|
||||
}
|
||||
|
||||
if (build_session (session_path,
|
||||
session_name,
|
||||
cchns,
|
||||
mchns,
|
||||
iconnect,
|
||||
oconnect,
|
||||
nphysin,
|
||||
nphysout,
|
||||
engine->frame_rate() * 60 * 5)) {
|
||||
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
if (build_session_from_nsd (session_path, session_name)) {
|
||||
response = RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
new_session_dialog->hide ();
|
||||
goto_editor_window ();
|
||||
flush_pending ();
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
try_again:
|
||||
if (response == Gtk::RESPONSE_NONE) {
|
||||
loading_dialog->hide ();
|
||||
new_session_dialog->set_existing_session (false);
|
||||
new_session_dialog->reset ();
|
||||
loadit:
|
||||
new_session_dialog->hide ();
|
||||
|
||||
if (load_session (session_path, session_name)) {
|
||||
/* force a retry */
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
}
|
||||
|
||||
try_again:
|
||||
if (response == Gtk::RESPONSE_NONE) {
|
||||
loading_dialog->hide ();
|
||||
new_session_dialog->set_existing_session (false);
|
||||
new_session_dialog->reset ();
|
||||
}
|
||||
}
|
||||
|
||||
} while (response == Gtk::RESPONSE_NONE);
|
||||
|
|
@ -2421,6 +2370,8 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
|
|||
show();
|
||||
loading_dialog->hide ();
|
||||
new_session_dialog->hide();
|
||||
new_session_dialog->reset();
|
||||
goto_editor_window ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -2433,7 +2384,7 @@ ARDOUR_UI::close_session ()
|
|||
|
||||
unload_session (true);
|
||||
|
||||
get_session_parameters ("", true, false);
|
||||
get_session_parameters (true, false);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -2467,10 +2418,13 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na
|
|||
goto out;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// OS X where everything is sllloooowwww
|
||||
if (loading_dialog) {
|
||||
loading_dialog->set_markup (_("Please wait while Ardour loads your session"));
|
||||
flush_pending ();
|
||||
}
|
||||
#endif
|
||||
|
||||
disable_screen_updates ();
|
||||
|
||||
|
|
@ -2612,28 +2566,52 @@ ARDOUR_UI::show ()
|
|||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::show_splash ()
|
||||
ARDOUR_UI::show_about ()
|
||||
{
|
||||
if (about == 0) {
|
||||
about = new About();
|
||||
about = new About;
|
||||
about->signal_response().connect(mem_fun (*this, &ARDOUR_UI::about_signal_response) );
|
||||
}
|
||||
about->present();
|
||||
flush_pending ();
|
||||
|
||||
about->show_all ();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::hide_about ()
|
||||
{
|
||||
if (about) {
|
||||
about->get_window()->set_cursor ();
|
||||
about->hide ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::about_signal_response(int response)
|
||||
{
|
||||
hide_splash();
|
||||
hide_about();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::show_splash ()
|
||||
{
|
||||
if (splash == 0) {
|
||||
try {
|
||||
splash = new Splash;
|
||||
} catch (...) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
splash->show ();
|
||||
splash->get_window()->process_updates (true);
|
||||
flush_pending ();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::hide_splash ()
|
||||
{
|
||||
if (about) {
|
||||
about->get_window()->set_cursor ();
|
||||
about->hide();
|
||||
if (splash) {
|
||||
splash->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3041,26 +3019,6 @@ ARDOUR_UI::reconnect_to_jack ()
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
ARDOUR_UI::cmdline_new_session (string path)
|
||||
{
|
||||
if (path[0] != '/') {
|
||||
char buf[PATH_MAX+1];
|
||||
string str;
|
||||
|
||||
getcwd (buf, sizeof (buf));
|
||||
str = buf;
|
||||
str += '/';
|
||||
str += path;
|
||||
path = str;
|
||||
}
|
||||
|
||||
get_session_parameters (path, false, true);
|
||||
|
||||
_will_create_new_session_automatically = false; /* done it */
|
||||
return FALSE; /* don't call it again */
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::use_config ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class Mixer_UI;
|
|||
class ConnectionEditor;
|
||||
class RouteParams_UI;
|
||||
class About;
|
||||
class Splash;
|
||||
class AddRouteDialog;
|
||||
class LocationUI;
|
||||
class ThemeManager;
|
||||
|
|
@ -110,6 +111,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
void show_splash ();
|
||||
void hide_splash ();
|
||||
|
||||
void show_about ();
|
||||
void hide_about ();
|
||||
|
||||
int load_session (const Glib::ustring & path, const Glib::ustring& snapshot, Glib::ustring mix_template = Glib::ustring());
|
||||
bool session_loaded;
|
||||
int build_session (const Glib::ustring& path, const Glib::ustring& snapshot,
|
||||
|
|
@ -132,8 +136,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
_will_create_new_session_automatically = yn;
|
||||
}
|
||||
|
||||
bool get_session_parameters (Glib::ustring path, bool have_engine = false, bool should_be_new = false);
|
||||
gint cmdline_new_session (string path);
|
||||
bool get_session_parameters (bool have_engine = false, bool should_be_new = false);
|
||||
void parse_cmdline_path (const Glib::ustring& cmdline_path, Glib::ustring& session_name, Glib::ustring& session_path, bool& existing_session);
|
||||
int load_cmdline_session (const Glib::ustring& session_name, const Glib::ustring& session_path, bool& existing_session);
|
||||
int build_session_from_nsd (const Glib::ustring& session_name, const Glib::ustring& session_path);
|
||||
bool ask_about_loading_existing_session (const Glib::ustring& session_path);
|
||||
int unload_session (bool hide_stuff = false);
|
||||
void close_session();
|
||||
|
||||
|
|
@ -639,6 +646,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
void count_recenabled_streams (ARDOUR::Route&);
|
||||
|
||||
About* about;
|
||||
Splash* splash;
|
||||
bool shown_flag;
|
||||
/* cleanup */
|
||||
|
||||
|
|
|
|||
|
|
@ -111,12 +111,15 @@ ARDOUR_UI::goto_editor_window ()
|
|||
{
|
||||
editor->show_window ();
|
||||
editor->present();
|
||||
flush_pending ();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::goto_mixer_window ()
|
||||
{
|
||||
mixer->show_window ();
|
||||
mixer->present();
|
||||
flush_pending ();
|
||||
}
|
||||
|
||||
gint
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ ARDOUR_UI::install_actions ()
|
|||
|
||||
/* the real actions */
|
||||
|
||||
act = ActionManager::register_action (main_actions, X_("New"), _("New"), hide_return (bind (mem_fun(*this, &ARDOUR_UI::get_session_parameters), string (), true, true)));
|
||||
act = ActionManager::register_action (main_actions, X_("New"), _("New"), hide_return (bind (mem_fun(*this, &ARDOUR_UI::get_session_parameters), true, true)));
|
||||
|
||||
ActionManager::register_action (main_actions, X_("Open"), _("Open"), mem_fun(*this, &ARDOUR_UI::open_session));
|
||||
ActionManager::register_action (main_actions, X_("Recent"), _("Recent"), mem_fun(*this, &ARDOUR_UI::open_recent_session));
|
||||
|
|
@ -207,7 +207,7 @@ ARDOUR_UI::install_actions ()
|
|||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (common_actions, X_("ToggleBigClock"), _("Big Clock"), mem_fun(*this, &ARDOUR_UI::toggle_big_clock_window));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::register_action (common_actions, X_("About"), _("About"), mem_fun(*this, &ARDOUR_UI::show_splash));
|
||||
ActionManager::register_action (common_actions, X_("About"), _("About"), mem_fun(*this, &ARDOUR_UI::show_about));
|
||||
ActionManager::register_toggle_action (common_actions, X_("ToggleThemeManager"), _("Theme Manager"), mem_fun(*this, &ARDOUR_UI::toggle_theme_manager));
|
||||
ActionManager::register_toggle_action (common_actions, X_("ToggleKeyEditor"), _("Keybindings"), mem_fun(*this, &ARDOUR_UI::toggle_key_editor));
|
||||
|
||||
|
|
|
|||
|
|
@ -1200,6 +1200,7 @@ AudioRegionView::set_frame_color ()
|
|||
(*w)->property_wave_color() = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA);
|
||||
} else {
|
||||
(*w)->property_wave_color() = ARDOUR_UI::config()->canvasvar_WaveForm.get();
|
||||
(*w)->property_fill_color() = ARDOUR_UI::config()->canvasvar_WaveFormFill.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ enum {
|
|||
PROP_WAVE_COLOR,
|
||||
PROP_CLIP_COLOR,
|
||||
PROP_ZERO_COLOR,
|
||||
PROP_FILL_COLOR,
|
||||
PROP_FILLED,
|
||||
PROP_RECTIFIED,
|
||||
PROP_ZERO_LINE,
|
||||
PROP_REGION_START,
|
||||
PROP_LOGSCALED,
|
||||
};
|
||||
|
|
@ -266,6 +269,20 @@ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
|
|||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_FILL_COLOR,
|
||||
g_param_spec_uint ("fill_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_FILLED,
|
||||
g_param_spec_boolean ("filled", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_RECTIFIED,
|
||||
|
|
@ -273,6 +290,13 @@ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
|
|||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_ZERO_LINE,
|
||||
g_param_spec_boolean ("zero_line", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_LOGSCALED,
|
||||
|
|
@ -335,6 +359,8 @@ gnome_canvas_waveview_init (GnomeCanvasWaveView *waveview)
|
|||
waveview->gain_src = NULL;
|
||||
waveview->rectified = FALSE;
|
||||
waveview->logscaled = FALSE;
|
||||
waveview->filled = TRUE;
|
||||
waveview->zero_line = FALSE;
|
||||
waveview->region_start = 0;
|
||||
waveview->samples_per_unit = 1.0;
|
||||
waveview->amplitude_above_axis = 1.0;
|
||||
|
|
@ -345,6 +371,7 @@ gnome_canvas_waveview_init (GnomeCanvasWaveView *waveview)
|
|||
waveview->wave_color = RGBA_TO_UINT(44,35,126,255);
|
||||
waveview->clip_color = RGBA_TO_UINT(44,0,0,100);
|
||||
waveview->zero_color = RGBA_TO_UINT(44,0,128,100);
|
||||
waveview->fill_color = RGBA_TO_UINT(44,35,126,128);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -830,12 +857,34 @@ gnome_canvas_waveview_set_property (GObject *object,
|
|||
}
|
||||
break;
|
||||
|
||||
case PROP_FILL_COLOR:
|
||||
if (waveview->fill_color != g_value_get_uint(value)) {
|
||||
waveview->fill_color = g_value_get_uint(value);
|
||||
redraw = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_FILLED:
|
||||
if (waveview->filled != g_value_get_boolean(value)) {
|
||||
waveview->filled = g_value_get_boolean(value);
|
||||
redraw = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_RECTIFIED:
|
||||
if (waveview->rectified != g_value_get_boolean(value)) {
|
||||
waveview->rectified = g_value_get_boolean(value);
|
||||
redraw = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_ZERO_LINE:
|
||||
if (waveview->zero_line != g_value_get_boolean(value)) {
|
||||
waveview->zero_line = g_value_get_boolean(value);
|
||||
redraw = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_LOGSCALED:
|
||||
if (waveview->logscaled != g_value_get_boolean(value)) {
|
||||
waveview->logscaled = g_value_get_boolean(value);
|
||||
|
|
@ -950,10 +999,22 @@ gnome_canvas_waveview_get_property (GObject *object,
|
|||
g_value_set_uint (value, waveview->zero_color);
|
||||
break;
|
||||
|
||||
case PROP_FILL_COLOR:
|
||||
g_value_set_uint (value, waveview->fill_color);
|
||||
break;
|
||||
|
||||
case PROP_FILLED:
|
||||
g_value_set_boolean (value, waveview->filled);
|
||||
break;
|
||||
|
||||
case PROP_RECTIFIED:
|
||||
g_value_set_boolean (value, waveview->rectified);
|
||||
break;
|
||||
|
||||
case PROP_ZERO_LINE:
|
||||
g_value_set_boolean (value, waveview->zero_line);
|
||||
break;
|
||||
|
||||
case PROP_LOGSCALED:
|
||||
g_value_set_boolean (value, waveview->logscaled);
|
||||
break;
|
||||
|
|
@ -1012,6 +1073,8 @@ gnome_canvas_waveview_update (GnomeCanvasItem *item, double *affine, ArtSVP *cli
|
|||
&waveview->wave_a);
|
||||
UINT_TO_RGBA (waveview->clip_color, &waveview->clip_r, &waveview->clip_g, &waveview->clip_b,
|
||||
&waveview->clip_a);
|
||||
UINT_TO_RGBA (waveview->fill_color, &waveview->fill_r, &waveview->fill_g, &waveview->fill_b,
|
||||
&waveview->fill_a);
|
||||
|
||||
// check_cache (waveview, "end of update");
|
||||
}
|
||||
|
|
@ -1028,6 +1091,7 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
|||
double half_height;
|
||||
int x, end, begin;
|
||||
int zbegin, zend;
|
||||
char rectify;
|
||||
|
||||
waveview = GNOME_CANVAS_WAVEVIEW (item);
|
||||
|
||||
|
|
@ -1107,10 +1171,18 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
|||
waveview->reload_cache_in_render = FALSE;
|
||||
}
|
||||
|
||||
cache_index = gnome_canvas_waveview_ensure_cache (waveview, s1, s2);
|
||||
|
||||
// check_cache (waveview, "post-ensure");
|
||||
|
||||
/* don't rectify at single-sample zoom */
|
||||
if(waveview->rectified && waveview->samples_per_unit > 1) {
|
||||
rectify = TRUE;
|
||||
}
|
||||
else {
|
||||
rectify = FALSE;
|
||||
}
|
||||
|
||||
clip_length = MIN(5,(waveview->height/4));
|
||||
|
||||
/*
|
||||
Now draw each line, clipping it appropriately. The clipping
|
||||
is done by the macros PAINT_FOO().
|
||||
|
|
@ -1119,83 +1191,401 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
|
|||
half_height = waveview->half_height;
|
||||
|
||||
/* this makes it slightly easier to comprehend whats going on */
|
||||
|
||||
#define origin half_height
|
||||
|
||||
|
||||
for (x = begin; x < end; x++) {
|
||||
|
||||
if(waveview->filled && !rectify) {
|
||||
int prev_pymin = 1;
|
||||
int prev_pymax = 0;
|
||||
int last_pymin = 1;
|
||||
int last_pymax = 0;
|
||||
int next_pymin, next_pymax;
|
||||
double max, min;
|
||||
int clip_max, clip_min;
|
||||
int next_clip_max = 0;
|
||||
int next_clip_min = 0;
|
||||
|
||||
clip_max = 0;
|
||||
clip_min = 0;
|
||||
if(s1 < waveview->samples_per_unit) {
|
||||
/* we haven't got a prev vars to compare with, so outline the whole line here */
|
||||
prev_pymax = (int) rint ((item->y1 + origin) * item->canvas->pixels_per_unit);
|
||||
prev_pymin = prev_pymax;
|
||||
}
|
||||
else {
|
||||
s1 -= waveview->samples_per_unit;
|
||||
}
|
||||
|
||||
if(end == waveview->bbox_lrx) {
|
||||
/* we don't have the NEXT vars for the last sample */
|
||||
last_pymax = (int) rint ((item->y1 + origin) * item->canvas->pixels_per_unit);
|
||||
last_pymin = last_pymax;
|
||||
}
|
||||
else {
|
||||
s2 += waveview->samples_per_unit;
|
||||
}
|
||||
|
||||
cache_index = gnome_canvas_waveview_ensure_cache (waveview, s1, s2);
|
||||
|
||||
/*
|
||||
* Compute the variables outside the rendering rect
|
||||
*/
|
||||
if(prev_pymax != prev_pymin) {
|
||||
prev_pymax = (int) rint ((item->y1 + origin - MIN(waveview->cache->data[cache_index].max, 1.0) * half_height) * item->canvas->pixels_per_unit);
|
||||
prev_pymin = (int) rint ((item->y1 + origin - MAX(waveview->cache->data[cache_index].min, -1.0) * half_height) * item->canvas->pixels_per_unit);
|
||||
++cache_index;
|
||||
}
|
||||
if(last_pymax != last_pymin) {
|
||||
/* take the index of one sample right of what we render */
|
||||
int index = cache_index + (end - begin);
|
||||
|
||||
last_pymax = (int) rint ((item->y1 + origin - MIN(waveview->cache->data[index].max, 1.0) * half_height) * item->canvas->pixels_per_unit);
|
||||
last_pymin = (int) rint ((item->y1 + origin - MAX(waveview->cache->data[index].min, -1.0) * half_height) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
/*
|
||||
* initialize NEXT* variables for the first run, duplicated in the loop for speed
|
||||
*/
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
clip_max = 1;
|
||||
next_clip_max = 1;
|
||||
}
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
clip_min = 1;
|
||||
next_clip_min = 1;
|
||||
}
|
||||
|
||||
/* don't rectify at single-sample zoom */
|
||||
max *= half_height;
|
||||
min *= half_height;
|
||||
|
||||
if (waveview->rectified && waveview->samples_per_unit > 1) {
|
||||
next_pymax = (int) rint ((item->y1 + origin - max) * item->canvas->pixels_per_unit);
|
||||
next_pymin = (int) rint ((item->y1 + origin - min) * item->canvas->pixels_per_unit);
|
||||
|
||||
/*
|
||||
* And now the loop
|
||||
*/
|
||||
for(x = begin; x < end; ++x) {
|
||||
int clip_max = next_clip_max;
|
||||
int clip_min = next_clip_min;
|
||||
int fill_max, fill_min;
|
||||
|
||||
pymax = next_pymax;
|
||||
pymin = next_pymin;
|
||||
|
||||
/* compute next */
|
||||
if(x == end - 1) {
|
||||
/*next is now the last column, which is outside the rendering rect, and possibly outside the region*/
|
||||
next_pymax = last_pymax;
|
||||
next_pymin = last_pymin;
|
||||
}
|
||||
else {
|
||||
++cache_index;
|
||||
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
next_clip_max = 0;
|
||||
next_clip_min = 0;
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
next_clip_max = 1;
|
||||
}
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
next_clip_min = 1;
|
||||
}
|
||||
|
||||
max *= half_height;
|
||||
min *= half_height;
|
||||
|
||||
next_pymax = (int) rint ((item->y1 + origin - max) * item->canvas->pixels_per_unit);
|
||||
next_pymin = (int) rint ((item->y1 + origin - min) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
/* render */
|
||||
if (pymax == pymin) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin);
|
||||
} else {
|
||||
if((prev_pymax < pymax && next_pymax < pymax) ||
|
||||
(prev_pymax == pymax && next_pymax == pymax)) {
|
||||
fill_max = pymax + 1;
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax);
|
||||
}
|
||||
else {
|
||||
fill_max = MAX(prev_pymax, next_pymax);
|
||||
if(pymax == fill_max) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax);
|
||||
++fill_max;
|
||||
}
|
||||
else {
|
||||
PAINT_VERTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax, fill_max);
|
||||
}
|
||||
}
|
||||
|
||||
if((prev_pymin > pymin && next_pymin > pymin) ||
|
||||
(prev_pymin == pymin && next_pymin == pymin)) {
|
||||
fill_min = pymin - 1;
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin-1);
|
||||
}
|
||||
else {
|
||||
fill_min = MIN(prev_pymin, next_pymin);
|
||||
if(pymin == fill_min) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin);
|
||||
}
|
||||
else {
|
||||
PAINT_VERTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, fill_min, pymin);
|
||||
}
|
||||
}
|
||||
|
||||
if(fill_max < fill_min) {
|
||||
PAINT_VERTA(buf, waveview->fill_r, waveview->fill_g, waveview->fill_b, waveview->fill_a, x, fill_max, fill_min);
|
||||
}
|
||||
else if(fill_max == fill_min) {
|
||||
PAINT_DOTA(buf, waveview->fill_r, waveview->fill_g, waveview->fill_b, waveview->fill_a, x, fill_max);
|
||||
}
|
||||
}
|
||||
|
||||
if (clip_max) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymax, pymax+clip_length);
|
||||
}
|
||||
|
||||
if (clip_min) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymin-clip_length, pymin);
|
||||
}
|
||||
|
||||
prev_pymax = pymax;
|
||||
prev_pymin = pymin;
|
||||
}
|
||||
}
|
||||
else if(waveview->filled && rectify) {
|
||||
int prev_pymax = -1;
|
||||
int last_pymax = -1;
|
||||
int next_pymax;
|
||||
double max, min;
|
||||
int next_clip_max = 0;
|
||||
int next_clip_min = 0;
|
||||
|
||||
// for rectified, this stays constant throughout the loop
|
||||
pymin = (int) rint ((item->y1 + waveview->height) * item->canvas->pixels_per_unit);
|
||||
|
||||
if(s1 < waveview->samples_per_unit) {
|
||||
/* we haven't got a prev vars to compare with, so outline the whole line here */
|
||||
prev_pymax = pymin;
|
||||
}
|
||||
else {
|
||||
s1 -= waveview->samples_per_unit;
|
||||
}
|
||||
|
||||
if(end == waveview->bbox_lrx) {
|
||||
/* we don't have the NEXT vars for the last sample */
|
||||
last_pymax = pymin;
|
||||
}
|
||||
else {
|
||||
s2 += waveview->samples_per_unit;
|
||||
}
|
||||
|
||||
cache_index = gnome_canvas_waveview_ensure_cache (waveview, s1, s2);
|
||||
|
||||
/*
|
||||
* Compute the variables outside the rendering rect
|
||||
*/
|
||||
if(prev_pymax < 0) {
|
||||
max = MIN(waveview->cache->data[cache_index].max, 1.0);
|
||||
min = MAX(waveview->cache->data[cache_index].min, -1.0);
|
||||
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
|
||||
max = max * waveview->height;
|
||||
prev_pymax = (int) rint ((item->y1 + waveview->height - max * waveview->height) * item->canvas->pixels_per_unit);
|
||||
++cache_index;
|
||||
}
|
||||
if(last_pymax < 0) {
|
||||
/* take the index of one sample right of what we render */
|
||||
int index = cache_index + (end - begin);
|
||||
|
||||
pymax = (int) rint ((item->y1 + waveview->height - max) * item->canvas->pixels_per_unit);
|
||||
pymin = (int) rint ((item->y1 + waveview->height) * item->canvas->pixels_per_unit);
|
||||
max = MIN(waveview->cache->data[index].max, 1.0);
|
||||
min = MAX(waveview->cache->data[index].min, -1.0);
|
||||
|
||||
} else {
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
|
||||
max = max * half_height;
|
||||
min = min * half_height;
|
||||
|
||||
pymax = (int) rint ((item->y1 + origin - max) * item->canvas->pixels_per_unit);
|
||||
pymin = (int) rint ((item->y1 + origin - min) * item->canvas->pixels_per_unit);
|
||||
last_pymax = (int) rint ((item->y1 + waveview->height - max * waveview->height) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
/* OK, now fill the RGB buffer at x=i with a line between pymin and pymax,
|
||||
or, if samples_per_unit == 1, then a dot at each location.
|
||||
*/
|
||||
/*
|
||||
* initialize NEXT* variables for the first run, duplicated in the loop for speed
|
||||
*/
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
if (pymax == pymin) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin);
|
||||
} else {
|
||||
PAINT_VERTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax, pymin);
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
next_clip_max = 1;
|
||||
}
|
||||
|
||||
/* show clipped waveforms with small red lines */
|
||||
|
||||
if (clip_max || clip_min) {
|
||||
clip_length = MIN(5,(waveview->height/4));
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
next_clip_min = 1;
|
||||
}
|
||||
|
||||
if (clip_max) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymax, pymax+clip_length);
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
|
||||
if (clip_min) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymin-clip_length, pymin);
|
||||
next_pymax = (int) rint ((item->y1 + waveview->height - max * waveview->height) * item->canvas->pixels_per_unit);
|
||||
|
||||
/*
|
||||
* And now the loop
|
||||
*/
|
||||
for(x = begin; x < end; ++x) {
|
||||
int clip_max = next_clip_max;
|
||||
int clip_min = next_clip_min;
|
||||
int fill_max;
|
||||
|
||||
pymax = next_pymax;
|
||||
|
||||
/* compute next */
|
||||
if(x == end - 1) {
|
||||
/*next is now the last column, which is outside the rendering rect, and possibly outside the region*/
|
||||
next_pymax = last_pymax;
|
||||
}
|
||||
else {
|
||||
++cache_index;
|
||||
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
next_clip_max = 1;
|
||||
}
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
next_clip_min = 1;
|
||||
}
|
||||
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
|
||||
next_pymax = (int) rint ((item->y1 + waveview->height - max * waveview->height) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
/* render */
|
||||
if (pymax == pymin) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin);
|
||||
} else {
|
||||
if((prev_pymax < pymax && next_pymax < pymax) ||
|
||||
(prev_pymax == pymax && next_pymax == pymax)) {
|
||||
fill_max = pymax + 1;
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax);
|
||||
}
|
||||
else {
|
||||
fill_max = MAX(prev_pymax, next_pymax);
|
||||
if(pymax == fill_max) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax);
|
||||
++fill_max;
|
||||
}
|
||||
else {
|
||||
PAINT_VERTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax, fill_max);
|
||||
}
|
||||
}
|
||||
|
||||
if(fill_max < pymin) {
|
||||
PAINT_VERTA(buf, waveview->fill_r, waveview->fill_g, waveview->fill_b, waveview->fill_a, x, fill_max, pymin);
|
||||
}
|
||||
else if(fill_max == pymin) {
|
||||
PAINT_DOTA(buf, waveview->fill_r, waveview->fill_g, waveview->fill_b, waveview->fill_a, x, pymin);
|
||||
}
|
||||
}
|
||||
|
||||
if (clip_max) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymax, pymax+clip_length);
|
||||
}
|
||||
|
||||
if (clip_min) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymin-clip_length, pymin);
|
||||
}
|
||||
|
||||
prev_pymax = pymax;
|
||||
}
|
||||
}
|
||||
else {
|
||||
cache_index = gnome_canvas_waveview_ensure_cache (waveview, s1, s2);
|
||||
|
||||
/* presto, we're done */
|
||||
for (x = begin; x < end; x++) {
|
||||
|
||||
cache_index++;
|
||||
double max, min;
|
||||
int clip_max, clip_min;
|
||||
|
||||
clip_max = 0;
|
||||
clip_min = 0;
|
||||
|
||||
max = waveview->cache->data[cache_index].max;
|
||||
min = waveview->cache->data[cache_index].min;
|
||||
|
||||
if (max >= 1.0) {
|
||||
max = 1.0;
|
||||
clip_max = 1;
|
||||
}
|
||||
|
||||
if (min <= -1.0) {
|
||||
min = -1.0;
|
||||
clip_min = 1;
|
||||
}
|
||||
|
||||
if (rectify) {
|
||||
|
||||
if (fabs (min) > fabs (max)) {
|
||||
max = fabs (min);
|
||||
}
|
||||
|
||||
max = max * waveview->height;
|
||||
|
||||
pymax = (int) rint ((item->y1 + waveview->height - max) * item->canvas->pixels_per_unit);
|
||||
pymin = (int) rint ((item->y1 + waveview->height) * item->canvas->pixels_per_unit);
|
||||
|
||||
} else {
|
||||
|
||||
max = max * half_height;
|
||||
min = min * half_height;
|
||||
|
||||
pymax = (int) rint ((item->y1 + origin - max) * item->canvas->pixels_per_unit);
|
||||
pymin = (int) rint ((item->y1 + origin - min) * item->canvas->pixels_per_unit);
|
||||
}
|
||||
|
||||
/* OK, now fill the RGB buffer at x=i with a line between pymin and pymax,
|
||||
or, if samples_per_unit == 1, then a dot at each location.
|
||||
*/
|
||||
|
||||
if (pymax == pymin) {
|
||||
PAINT_DOTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymin);
|
||||
} else {
|
||||
PAINT_VERTA(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax, pymin);
|
||||
}
|
||||
|
||||
/* show clipped waveforms with small red lines */
|
||||
|
||||
if (clip_max) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymax, pymax+clip_length);
|
||||
}
|
||||
|
||||
if (clip_min) {
|
||||
PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a, x, pymin-clip_length, pymin);
|
||||
}
|
||||
|
||||
/* presto, we're done */
|
||||
|
||||
cache_index++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!waveview->rectified) {
|
||||
if (!waveview->rectified && waveview->zero_line) {
|
||||
// Paint zeroline.
|
||||
//PAINT_HORIZA(buf, waveview->zero_r, waveview->zero_g, waveview->zero_b, waveview->zero_a, begin, endi-1, origin );
|
||||
|
||||
|
|
|
|||
|
|
@ -101,8 +101,11 @@ struct _GnomeCanvasWaveView
|
|||
uint32_t wave_color;
|
||||
uint32_t clip_color;
|
||||
uint32_t zero_color;
|
||||
uint32_t fill_color;
|
||||
|
||||
char filled;
|
||||
char rectified;
|
||||
char zero_line;
|
||||
char logscaled;
|
||||
|
||||
/* These are updated by the update() routine
|
||||
|
|
@ -116,6 +119,7 @@ struct _GnomeCanvasWaveView
|
|||
int32_t bbox_lry;
|
||||
unsigned char wave_r, wave_g, wave_b, wave_a;
|
||||
unsigned char clip_r, clip_g, clip_b, clip_a;
|
||||
unsigned char fill_r, fill_g, fill_b, fill_a;
|
||||
uint32_t samples;
|
||||
uint32_t region_start;
|
||||
int32_t reload_cache_in_render;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
CANVAS_VARIABLE(canvasvar_WaveForm, "waveform")
|
||||
CANVAS_VARIABLE(canvasvar_WaveFormFill, "waveform fill")
|
||||
CANVAS_VARIABLE(canvasvar_WaveFormClip, "clipped waveform")
|
||||
CANVAS_VARIABLE(canvasvar_FrameBase, "region base")
|
||||
CANVAS_VARIABLE(canvasvar_SelectedFrameBase, "selected region base")
|
||||
|
|
|
|||
|
|
@ -59,16 +59,6 @@ extern int curvetest (string);
|
|||
static ARDOUR_UI *ui = 0;
|
||||
static char* localedir = LOCALEDIR;
|
||||
|
||||
gint
|
||||
show_ui_callback (void *arg)
|
||||
{
|
||||
ARDOUR_UI * ui = (ARDOUR_UI *) arg;
|
||||
|
||||
ui->hide_splash();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#include <mach-o/dyld.h>
|
||||
|
|
@ -335,13 +325,6 @@ int main (int argc, char* argv[])
|
|||
exit (1);
|
||||
}
|
||||
|
||||
if (!no_splash) {
|
||||
ui->show_splash ();
|
||||
if (session_name.length()) {
|
||||
g_timeout_add (4000, show_ui_callback, ui);
|
||||
}
|
||||
}
|
||||
|
||||
setup_keybindings (ui);
|
||||
|
||||
ui->run (text_receiver);
|
||||
|
|
|
|||
|
|
@ -378,12 +378,9 @@ NewSessionDialog::NewSessionDialog()
|
|||
title += _("Session Control");
|
||||
set_title(title.get_string());
|
||||
|
||||
//set_modal(false);
|
||||
//property_window_position().set_value(Gtk::WIN_POS_NONE);
|
||||
set_position (Gtk::WIN_POS_MOUSE);
|
||||
set_resizable(false);
|
||||
//property_destroy_with_parent().set_value(false);
|
||||
set_has_separator(false);
|
||||
// add_button(Gtk::Stock::HELP, Gtk::RESPONSE_HELP);
|
||||
add_button(Gtk::Stock::QUIT, Gtk::RESPONSE_CANCEL);
|
||||
add_button(Gtk::Stock::CLEAR, Gtk::RESPONSE_NONE);
|
||||
m_okbutton = add_button(Gtk::Stock::NEW, Gtk::RESPONSE_OK);
|
||||
|
|
@ -906,7 +903,7 @@ NewSessionDialog::template_chosen ()
|
|||
void
|
||||
NewSessionDialog::recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col)
|
||||
{
|
||||
response (Gtk::RESPONSE_YES);
|
||||
response (Gtk::RESPONSE_OK);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -176,7 +176,9 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
|
|||
|
||||
label_view ();
|
||||
|
||||
if (!Profile->get_sae()) {
|
||||
if (0) {
|
||||
|
||||
/* old school - when we used to put an extra row of buttons in place */
|
||||
|
||||
controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
|
|
@ -185,11 +187,11 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
|
|||
|
||||
} else {
|
||||
|
||||
controls_table.attach (automation_button, 4, 5, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
controls_table.attach (automation_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
}
|
||||
|
||||
if (is_track() && track()->mode() == ARDOUR::Normal) {
|
||||
controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
controls_table.attach (playlist_button, 4, 5, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
}
|
||||
|
||||
y_position = -1;
|
||||
|
|
|
|||
55
gtk2_ardour/splash.cc
Normal file
55
gtk2_ardour/splash.cc
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#include <string>
|
||||
|
||||
#include <pbd/failed_constructor.h>
|
||||
#include <ardour/ardour.h>
|
||||
|
||||
#include "splash.h"
|
||||
|
||||
using namespace Gtk;
|
||||
using namespace Glib;
|
||||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
|
||||
Splash::Splash ()
|
||||
{
|
||||
string path = find_data_file ("splash.png");
|
||||
|
||||
if (path.empty()) {
|
||||
throw failed_constructor();
|
||||
}
|
||||
|
||||
try {
|
||||
pixbuf = Gdk::Pixbuf::create_from_file (path);
|
||||
}
|
||||
|
||||
catch (...) {
|
||||
throw failed_constructor();
|
||||
}
|
||||
|
||||
set_size_request (pixbuf->get_width(), pixbuf->get_height());
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
|
||||
set_keep_above (true);
|
||||
set_position (WIN_POS_CENTER);
|
||||
add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
||||
}
|
||||
|
||||
bool
|
||||
Splash::on_button_release_event (GdkEventButton* ev)
|
||||
{
|
||||
hide ();
|
||||
}
|
||||
|
||||
bool
|
||||
Splash::on_expose_event (GdkEventExpose* ev)
|
||||
{
|
||||
RefPtr<Gdk::Window> window = get_window();
|
||||
|
||||
Window::on_expose_event (ev);
|
||||
|
||||
window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf,
|
||||
ev->area.x, ev->area.y,
|
||||
ev->area.x, ev->area.y,
|
||||
ev->area.width, ev->area.height,
|
||||
Gdk::RGB_DITHER_NONE, 0, 0);
|
||||
return true;
|
||||
}
|
||||
41
gtk2_ardour/splash.h
Normal file
41
gtk2_ardour/splash.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
Copyright (C) 2008 Paul Davis
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __ardour_gtk_splash_h__
|
||||
#define __ardour_gtk_splash_h__
|
||||
|
||||
#include <gtkmm/window.h>
|
||||
#include <gdkmm/pixbuf.h>
|
||||
|
||||
class ARDOUR_UI;
|
||||
|
||||
class Splash : public Gtk::Window
|
||||
{
|
||||
public:
|
||||
Splash ();
|
||||
~Splash () {}
|
||||
|
||||
bool on_expose_event (GdkEventExpose*);
|
||||
bool on_button_release_event (GdkEventButton*);
|
||||
|
||||
private:
|
||||
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_splash_h__ */
|
||||
|
|
@ -125,7 +125,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
|
|||
controls_table.set_col_spacings (0);
|
||||
controls_table.set_homogeneous (true);
|
||||
|
||||
controls_table.attach (name_hbox, 0, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||
controls_table.attach (name_hbox, 0, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 3, 0);
|
||||
controls_table.show_all ();
|
||||
controls_table.set_no_show_all ();
|
||||
|
||||
|
|
@ -140,8 +140,6 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
|
|||
controls_ebox.signal_button_release_event().connect (mem_fun (*this, &TimeAxisView::controls_ebox_button_release));
|
||||
controls_ebox.signal_scroll_event().connect (mem_fun (*this, &TimeAxisView::controls_ebox_scroll), true);
|
||||
|
||||
controls_lhs_pad.set_name ("TimeAxisViewControlsPadding");
|
||||
controls_hbox.pack_start (controls_lhs_pad,false,false);
|
||||
controls_hbox.pack_start (controls_ebox,true,true);
|
||||
controls_hbox.show ();
|
||||
|
||||
|
|
|
|||
|
|
@ -267,6 +267,22 @@ Glib::PropertyProxy_ReadOnly<guint> WaveView::property_zero_color() const
|
|||
{
|
||||
return Glib::PropertyProxy_ReadOnly<guint> (this, "zero_color");
|
||||
}
|
||||
Glib::PropertyProxy<guint> WaveView::property_fill_color()
|
||||
{
|
||||
return Glib::PropertyProxy<guint> (this, "fill_color");
|
||||
}
|
||||
Glib::PropertyProxy_ReadOnly<guint> WaveView::property_fill_color() const
|
||||
{
|
||||
return Glib::PropertyProxy_ReadOnly<guint> (this, "fill_color");
|
||||
}
|
||||
Glib::PropertyProxy<gint> WaveView::property_filled()
|
||||
{
|
||||
return Glib::PropertyProxy<gint> (this, "filled");
|
||||
}
|
||||
Glib::PropertyProxy_ReadOnly<gint> WaveView::property_filled() const
|
||||
{
|
||||
return Glib::PropertyProxy_ReadOnly<gint> (this, "filled");
|
||||
}
|
||||
Glib::PropertyProxy<gint> WaveView::property_rectified()
|
||||
{
|
||||
return Glib::PropertyProxy<gint> (this, "rectified");
|
||||
|
|
@ -275,6 +291,14 @@ Glib::PropertyProxy_ReadOnly<gint> WaveView::property_rectified() const
|
|||
{
|
||||
return Glib::PropertyProxy_ReadOnly<gint> (this, "rectified");
|
||||
}
|
||||
Glib::PropertyProxy<gint> WaveView::property_zero_line()
|
||||
{
|
||||
return Glib::PropertyProxy<gint> (this, "zero_line");
|
||||
}
|
||||
Glib::PropertyProxy_ReadOnly<gint> WaveView::property_zero_line() const
|
||||
{
|
||||
return Glib::PropertyProxy_ReadOnly<gint> (this, "zero_line");
|
||||
}
|
||||
Glib::PropertyProxy<guint> WaveView::property_region_start()
|
||||
{
|
||||
return Glib::PropertyProxy<guint> (this, "region_start");
|
||||
|
|
|
|||
|
|
@ -144,9 +144,15 @@ public:
|
|||
Glib::PropertyProxy_ReadOnly<guint> property_wave_color() const;
|
||||
Glib::PropertyProxy<guint> property_clip_color();
|
||||
Glib::PropertyProxy_ReadOnly<guint> property_clip_color() const;
|
||||
Glib::PropertyProxy<gint> property_rectified();
|
||||
Glib::PropertyProxy<guint> property_fill_color();
|
||||
Glib::PropertyProxy_ReadOnly<guint> property_fill_color() const;
|
||||
Glib::PropertyProxy<gint> property_filled();
|
||||
Glib::PropertyProxy_ReadOnly<gint> property_filled() const;
|
||||
Glib::PropertyProxy<gint> property_zero_line();
|
||||
Glib::PropertyProxy_ReadOnly<gint> property_zero_line() const;
|
||||
Glib::PropertyProxy<guint> property_zero_color();
|
||||
Glib::PropertyProxy_ReadOnly<guint> property_zero_color() const;
|
||||
Glib::PropertyProxy<gint> property_rectified();
|
||||
Glib::PropertyProxy_ReadOnly<gint> property_rectified() const;
|
||||
Glib::PropertyProxy<guint> property_region_start();
|
||||
Glib::PropertyProxy_ReadOnly<guint> property_region_start() const;
|
||||
|
|
|
|||
|
|
@ -526,6 +526,11 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_
|
|||
|
||||
commit_should_unlock = false;
|
||||
|
||||
if (!_io->active()) {
|
||||
_processed = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
check_record_status (transport_frame, nframes, can_record);
|
||||
|
||||
nominally_recording = (can_record && re);
|
||||
|
|
@ -742,6 +747,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_
|
|||
nframes_t total = chaninfo->playback_vector.len[0] + chaninfo->playback_vector.len[1];
|
||||
|
||||
if (necessary_samples > total) {
|
||||
cerr << "underrun for " << _name << endl;
|
||||
DiskUnderrun ();
|
||||
goto out;
|
||||
|
||||
|
|
@ -825,6 +831,10 @@ AudioDiskstream::commit (nframes_t nframes)
|
|||
{
|
||||
bool need_butler = false;
|
||||
|
||||
if (!_io->active()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_actual_speed < 0.0) {
|
||||
playback_sample -= playback_distance;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __ardour_svn_revision_h__
|
||||
#define __ardour_svn_revision_h__
|
||||
static const char* ardour_svn_revision = "2914";
|
||||
static const char* ardour_svn_revision = "2918";
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue