13
0
This commit is contained in:
Robin Gareus 2013-07-16 19:49:50 +02:00
commit ebcb1ffe7b
10 changed files with 61 additions and 30 deletions

View File

@ -658,7 +658,7 @@ AUPluginUI::parent_cocoa_window ()
/* move the au_view down so that it doesn't overlap the top_box contents */
NSPoint origin = { 0, a.height };
NSPoint origin = { 0, static_cast<CGFloat> (a.height) };
[au_view setFrameOrigin:origin];
[view addSubview:au_view positioned:NSWindowBelow relativeTo:nil];

View File

@ -997,18 +997,18 @@ AudioClock::set_slave_info ()
switch (sync_src) {
case JACK:
_left_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2</span></span>",
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span></span>",
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
_right_layout->set_text ("");
break;
case MIDIClock:
if (slave) {
_left_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2</span></span>",
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span></span>",
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
_right_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2</span></span>",
_right_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span></span>",
INFO_FONT_SIZE, slave->approximate_current_delta()));
} else {
_left_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2</span></span>",
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span></span>",
INFO_FONT_SIZE, _("--pending--")));
_right_layout->set_text ("");
}
@ -1020,21 +1020,21 @@ AudioClock::set_slave_info ()
TimecodeSlave* tcslave;
if ((tcslave = dynamic_cast<TimecodeSlave*>(_session->slave())) != 0) {
matching = (tcslave->apparent_timecode_format() == _session->config.get_timecode_format());
_left_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2</span><span foreground=\"%3\">%4</span></span>",
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span><span foreground=\"%3\">%4</span></span>",
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)[0], (matching?"green":"red"),
dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
_right_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2</span></span>",
_right_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span></span>",
INFO_FONT_SIZE, slave->approximate_current_delta()));
}
} else {
_left_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2</span></span>",
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span></span>",
INFO_FONT_SIZE, _("--pending--")));
_right_layout->set_text ("");
}
break;
}
} else {
_left_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"INT/%2</span></span>",
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "INT/%2</span></span>",
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
_right_layout->set_text ("");
}
@ -1079,17 +1079,17 @@ AudioClock::set_frames (framepos_t when, bool /*force*/)
sprintf (buf, "%" PRId64 "Hz", rate);
}
_left_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2 </span><span foreground=\"green\">%3</span></span>",
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2 </span><span foreground=\"green\">%3</span></span>",
INFO_FONT_SIZE, _("SR"), buf));
float vid_pullup = _session->config.get_video_pullup();
if (vid_pullup == 0.0) {
_right_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2 </span><span foreground=\"green\">off</span></span>",
_right_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2 </span><span foreground=\"green\">off</span></span>",
INFO_FONT_SIZE, _("Pull")));
} else {
sprintf (buf, _("%+.4f%%"), vid_pullup);
_right_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%2 </span><span foreground=\"green\">%3</span></span>",
_right_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2 </span><span foreground=\"green\">%3</span></span>",
INFO_FONT_SIZE, _("Pull"), buf));
}
}
@ -1233,11 +1233,11 @@ AudioClock::set_bbt (framepos_t when, bool /*force*/)
TempoMetric m (_session->tempo_map().metric_at (pos));
sprintf (buf, "%-5.1f", m.tempo().beats_per_minute());
_left_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%3</span> <span foreground=\"green\">%2</span></span>",
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%3</span> <span foreground=\"green\">%2</span></span>",
INFO_FONT_SIZE, buf, _("Tempo")));
sprintf (buf, "%g/%g", m.meter().divisions_per_bar(), m.meter().note_divisor());
_right_layout->set_markup (string_compose ("<span size=\"%1\">"TXTSPAN"%3</span> <span foreground=\"green\">%2</span></span>",
_right_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%3</span> <span foreground=\"green\">%2</span></span>",
INFO_FONT_SIZE, buf, _("Meter")));
}
}

View File

@ -112,7 +112,7 @@ set_language_preference ()
break;
}
}
NSRange r = { 0, count };
NSRange r = { 0, static_cast<NSUInteger> (count) };
setenv ("LANGUAGE", [[[languages subarrayWithRange:r] componentsJoinedByString:@":"] UTF8String], 0);
cout << "LANGUAGE set to " << getenv ("LANGUAGE") << endl;
}

View File

@ -151,7 +151,7 @@ class ProxyWithConstructor: public ProxyBase {
: ProxyBase (name, menu_name) , creator (c) {}
ProxyWithConstructor (const std::string& name, const std::string& menu_name, const boost::function<T*()>& c, const XMLNode* node)
: ProxyBase (name, menu_name, node) , creator (c) {}
: ProxyBase (name, menu_name, *node) , creator (c) {}
Gtk::Window* get (bool create = false) {
if (!_window) {
@ -198,7 +198,7 @@ class Proxy : public ProxyBase {
: ProxyBase (name, menu_name) {}
Proxy (const std::string& name, const std::string& menu_name, const XMLNode* node)
: ProxyBase (name, menu_name, node) {}
: ProxyBase (name, menu_name, *node) {}
Gtk::Window* get (bool create = false) {
if (!_window) {

View File

@ -3,6 +3,7 @@
#include "flag_field.h"
#include <cstdlib>
#include <string>
#ifdef __GNUC__
@ -24,7 +25,7 @@ struct DebugUtils
char * res = abi::__cxa_demangle (typeid(obj).name(), 0, 0, &status);
if (status == 0) {
std::string s(res);
free (res);
std::free (res);
return s;
}
#endif

View File

@ -123,7 +123,7 @@ public:
return time() < o.time();
}
if (bank != o.bank()) {
if (bank() != o.bank()) {
return bank() < o.bank();
}

View File

@ -24,6 +24,10 @@
#include <stdint.h>
#include <cstdio>
#if __clang__
#include "evoral/Note.hpp"
#endif
#include "pbd/compose.h"
#include "pbd/error.h"

View File

@ -20,11 +20,19 @@
#ifndef __libmisc_stl_delete_h__
#define __libmisc_stl_delete_h__
#if __clang__ && __APPLE__ && __cplusplus >= 201103L
#include <vector>
#ifndef _CPP_VECTOR
#define _CPP_VECTOR
#endif
#endif
/* To actually use any of these deletion functions, you need to
first include the revelant container type header.
*/
#if defined(_CPP_VECTOR) || defined(_GLIBCXX_VECTOR) || defined(__SGI_STL_VECTOR)
template<class T> void vector_delete (std::vector<T *> *vec)
template<class T> void vector_delete (std::vector<T *> *vec)
{
typename std::vector<T *>::iterator i;

View File

@ -56,17 +56,17 @@ probe_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/)
}
static ControlProtocolDescriptor generic_midi_descriptor = {
name : "Generic MIDI",
id : "uri://ardour.org/surfaces/generic_midi:0",
ptr : 0,
module : 0,
mandatory : 0,
supports_feedback : true,
probe : probe_generic_midi_protocol,
initialize : new_generic_midi_protocol,
destroy : delete_generic_midi_protocol
.name = "Generic MIDI",
.id = "uri://ardour.org/surfaces/generic_midi:0",
.ptr = 0,
.module = 0,
.mandatory = 0,
.supports_feedback = true,
.probe = probe_generic_midi_protocol,
.initialize = new_generic_midi_protocol,
.destroy = delete_generic_midi_protocol
};
extern "C" {
ControlProtocolDescriptor*

18
wscript
View File

@ -110,6 +110,22 @@ def set_compiler_flags (conf,opt):
# waf adds -O0 -g itself. thanks waf!
is_clang = conf.env['CXX'][0].endswith('clang++')
if conf.options.cxx11:
conf.check_cxx(cxxflags=["-std=c++11"])
conf.env.append_unique('CXXFLAGS', ['-std=c++11'])
if platform == "darwin":
conf.env.append_unique('CXXFLAGS', ['-stdlib=libc++'])
conf.env.append_unique('LINKFLAGS', ['-lc++'])
# Prevents visibility issues in standard headers
conf.define("_DARWIN_C_SOURCE", 1)
if is_clang and platform == "darwin":
# Silence warnings about the non-existing osx clang compiler flags
# -compatibility_version and -current_version. These are Waf
# generated and not needed with clang
conf.env.append_unique ("CXXFLAGS", ["-Qunused-arguments"])
if opt.gprofile:
debug_flags = [ '-pg' ]
@ -454,6 +470,8 @@ def options(opt):
help='directory where Wine\'s Windows header files can be found')
opt.add_option('--noconfirm', action='store_true', default=False, dest='noconfirm',
help='Do not ask questions that require confirmation during the build')
opt.add_option('--cxx11', action='store_true', default=False, dest='cxx11',
help='Turn on c++11 compiler flags (-std=c++11)')
for i in children:
opt.recurse(i)