13
0

switch to Lucida Sans Typewriter as OS X monospace font; new pingback code to get announcements from ardour.org (can be disabled on the command line with -a)

git-svn-id: svn://localhost/ardour2/branches/3.0@14189 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2013-03-08 16:41:45 +00:00
parent 3eef81daa2
commit ba73a77c63
7 changed files with 60 additions and 11 deletions

View File

@ -67,6 +67,7 @@
#include "ardour/automation_watch.h"
#include "ardour/diskstream.h"
#include "ardour/filename_extensions.h"
#include "ardour/filesystem_paths.h"
#include "ardour/port.h"
#include "ardour/process_thread.h"
#include "ardour/profile.h"
@ -101,6 +102,7 @@ typedef uint64_t microseconds_t;
#include "mixer_ui.h"
#include "mouse_cursors.h"
#include "opts.h"
#include "pingback.h"
#include "processor_box.h"
#include "prompter.h"
#include "public_editor.h"
@ -602,6 +604,33 @@ ARDOUR_UI::update_autosave ()
}
}
void
ARDOUR_UI::check_announcements ()
{
#ifdef PHONE_HOME
string _annc_filename;
#ifdef __APPLE__
_annc_filename = PROGRAM_NAME "_announcements_osx_";
#else
_annc_filename = PROGRAM_NAME "_announcements_linux_";
#endif
_annc_filename.append (VERSIONSTRING);
std::string path = Glib::build_filename (user_config_directory(), _annc_filename);
std::ifstream announce_file (path.c_str());
if ( announce_file.fail() )
_announce_string = "";
else {
std::stringstream oss;
oss << announce_file.rdbuf();
_announce_string = oss.str();
}
pingback (VERSIONSTRING, path);
#endif
}
void
ARDOUR_UI::startup ()
{
@ -610,9 +639,9 @@ ARDOUR_UI::startup ()
app->ShouldQuit.connect (sigc::mem_fun (*this, &ARDOUR_UI::queue_finish));
app->ShouldLoad.connect (sigc::mem_fun (*this, &ARDOUR_UI::idle_load));
#ifdef PHONE_HOME
call_the_mothership (VERSIONSTRING);
#endif
if (ARDOUR_COMMAND_LINE::check_announcements) {
check_announcements ();
}
app->ready ();

View File

@ -263,6 +263,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void get_process_buffers ();
void drop_process_buffers ();
const std::string& announce_string() const { return _announce_string; }
protected:
friend class PublicEditor;
@ -726,6 +728,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
bool _feedback_exists;
void resize_text_widgets ();
std::string _announce_string;
void check_announcements ();
};
#endif /* __ardour_gui_h__ */

View File

@ -222,7 +222,11 @@ fixup_bundle_environment (int, char* [])
}
static void load_custom_fonts() {
#if MAC_OS_X_VERSION_MIN_REQUIRED > 1060
/* this code will only compile on OS X 10.6 and above, and we currently do not
* need it anyway since we have no custom fonts on OS X. Leave it here in case
* we ever need to comeback to it.
*/
#if 0
std::string ardour_mono_file;
if (!find_file_in_search_path (ardour_data_search_path(), "ArdourMono.ttf", ardour_mono_file)) {
@ -240,8 +244,6 @@ static void load_custom_fonts() {
if (CTFontManagerRegisterFontsForURL(fontURL, kCTFontManagerScopeProcess, &error) != true) {
cerr << _("Cannot load ArdourMono TrueType font.") << endl;
}
#else
/* no real usable API for this on OS X 10.5 or below */
#endif
}

View File

@ -47,6 +47,7 @@ bool ARDOUR_COMMAND_LINE::finder_invoked_ardour = false;
string ARDOUR_COMMAND_LINE::immediate_save;
string ARDOUR_COMMAND_LINE::jack_session_uuid;
string ARDOUR_COMMAND_LINE::load_template;
bool ARDOUR_COMMAND_LINE::check_announcements = true;
using namespace ARDOUR_COMMAND_LINE;
@ -57,6 +58,7 @@ print_help (const char *execname)
<< _(" [SESSION_NAME] Name of session to load\n")
<< _(" -v, --version Show version information\n")
<< _(" -h, --help Print this message\n")
<< _(" -a, --no-announcements Do not contact website for announcements\n")
<< _(" -b, --bindings Print all possible keyboard binding names\n")
<< _(" -c, --name <name> Use a specific jack client name, default is ardour\n")
<< _(" -d, --disable-plugins Disable all plugins in an existing session\n")
@ -80,7 +82,7 @@ print_help (const char *execname)
int
ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
{
const char *optstring = "bc:C:dD:hk:E:m:N:nOp:PST:U:vV";
const char *optstring = "abc:C:dD:hk:E:m:N:nOp:PST:U:vV";
const char *execname = strrchr (argv[0], '/');
if (getenv ("ARDOUR_SAE")) {
@ -97,6 +99,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
const struct option longopts[] = {
{ "version", 0, 0, 'v' },
{ "help", 0, 0, 'h' },
{ "no-announcements", 0, 0, 'a' },
{ "bindings", 0, 0, 'b' },
{ "disable-plugins", 1, 0, 'd' },
{ "debug", 1, 0, 'D' },
@ -137,6 +140,10 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
print_help (execname);
exit (0);
break;
case 'a':
check_announcements = false;
break;
case 'b':
show_key_actions = true;
break;

View File

@ -41,6 +41,7 @@ extern bool finder_invoked_ardour;
extern std::string immediate_save;
extern std::string jack_session_uuid;
extern std::string load_template;
extern bool check_announcements;
extern int32_t parse_opts (int argc, char *argv[]);

View File

@ -168,6 +168,7 @@ gtk2_ardour_sources = [
'panner_interface.cc',
'panner_ui.cc',
'piano_roll_header.cc',
'pingback.cc',
'playlist_selector.cc',
'plugin_eq_gui.cc',
'plugin_selector.cc',

12
wscript
View File

@ -444,7 +444,10 @@ def options(opt):
opt.add_option('--nls', action='store_true', default=True, dest='nls',
help='Enable i18n (native language support) (default)')
opt.add_option('--no-nls', action='store_false', dest='nls')
opt.add_option('--phone-home', action='store_false', default=False, dest='phone_home')
opt.add_option('--phone-home', action='store_true', default=True, dest='phone_home',
help='Contact ardour.org at startup for new announcements')
opt.add_option('--no-phone-home', action='store_false', dest='phone_home',
help='Do not contact ardour.org at startup for new announcements')
opt.add_option('--stl-debug', action='store_true', default=False, dest='stl_debug',
help='Build with debugging for the STL')
opt.add_option('--rt-alloc-debug', action='store_true', default=False, dest='rt_alloc_debug',
@ -633,10 +636,11 @@ def configure(conf):
# Set up waf environment and C defines
opts = Options.options
if opts.debug:
opts.phone_home = False; # debug builds should not call home
print "PH = "
print opts.phone_home
if opts.phone_home:
conf.env['PHONE_HOME'] = opts.phone_home
conf.define('PHONE_HOME', 1)
conf.env['PHONE_HOME'] = True
if opts.fpu_optimization:
conf.env['FPU_OPTIMIZATION'] = True
if opts.freesound: