#include "pbd/signals.h"
#include "pbd/stacktrace.h"
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
#include <jack/weakjack.h>
#endif
#include <glibmm/threads.h>
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
#include "pbd/glib_semaphore.h"
#endif
uint32_t midi_dstream_buffer_size;
RingBuffer<CrossThreadPool*> pool_trash;
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
PBD::atomic_counter m_request_state;
PBD::GlibSemaphore m_request_sem;
#else
void empty_pool_trash ();
void config_changed (std::string);
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
int setup_request_pipe ();
#endif
* Jack 2 _jack arg is not used so it should be OK
*/
-#if defined(USING_JACK2_EXPANSION_OF_JACK_API) || defined(WIN32)
+#if defined(USING_JACK2_EXPANSION_OF_JACK_API) || defined(PLATFORM_WINDOWS)
if (jack_client_stop_thread (_jack, thread) != 0) {
error << "AudioEngine: cannot stop process thread" << endmsg;
return false;
#include <fcntl.h>
#include <unistd.h>
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
#include <poll.h>
#endif
}
}
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
int
Butler::setup_request_pipe ()
{
should_run = false;
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
if (setup_request_pipe() != 0) return -1;
#endif
bool
Butler::wait_for_requests ()
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
struct pollfd pfd[1];
pfd[0].fd = request_pipe[0];
bool
Butler::dequeue_request (Request::Type& r)
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
char req;
size_t nread = ::read (request_pipe[0], &req, sizeof (req));
if (nread == 1) {
Request::Type req;
/* empty the pipe of all current requests */
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
dequeue_request (req);
{
#else
void
Butler::queue_request (Request::Type r)
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
char c = r;
(void) ::write (request_pipe[1], &c, 1);
#else
goto out;
}
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
if (errno != ENOENT) {
error << string_compose(
_("Filesource: cannot check for existing file (%1): %2"),
std::string
ardour_dll_directory ()
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
std::string dll_dir_path(g_win32_get_package_installation_directory_of_module(NULL));
dll_dir_path = Glib::build_filename (dll_dir_path, "lib");
return Glib::build_filename (dll_dir_path, "ardour3");
#endif
}
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
SearchPath
windows_search_path ()
{
if (search_path.empty()) {
search_path += user_config_directory();
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
search_path += windows_search_path ();
#else
std::string s = Glib::getenv("ARDOUR_CONFIG_PATH");
if (search_path.empty()) {
search_path += user_config_directory();
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
search_path += windows_search_path ();
#else
std::string s = Glib::getenv("ARDOUR_DATA_PATH");
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
#include <sys/resource.h>
#endif
#include <unistd.h>
static void
lotsa_files_please ()
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
struct rlimit rl;
if (getrlimit (RLIMIT_NOFILE, &rl) == 0) {
int
IO::ensure_ports_locked (ChanCount count, bool clear, bool& changed)
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
assert (!AudioEngine::instance()->process_lock().trylock());
#endif
int
IO::ensure_ports (ChanCount count, bool clear, void* src)
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
assert (!AudioEngine::instance()->process_lock().trylock());
#endif
int
IO::ensure_io (ChanCount count, bool clear, void* src)
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
assert (!AudioEngine::instance()->process_lock().trylock());
#endif
void
ARDOUR::get_jack_audio_driver_names (vector<string>& audio_driver_names)
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
audio_driver_names.push_back (portaudio_driver_name);
#elif __APPLE__
audio_driver_names.push_back (coreaudio_driver_name);
ARDOUR::get_jack_midi_system_names (const string& driver, vector<string>& midi_system_names)
{
midi_system_names.push_back (get_none_string ());
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
midi_system_names.push_back (winmme_midi_driver_name);
#elif __APPLE__
midi_system_names.push_back (coreaudio_midi_driver_name);
bool
ARDOUR::get_jack_server_application_names (std::vector<std::string>& server_names)
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
server_names.push_back ("jackd.exe");
#else
server_names.push_back ("jackd");
SearchPath sp(string(g_getenv("PATH")));
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
gchar *install_dir = g_win32_get_package_installation_directory_of_module (NULL);
if (install_dir) {
sp.push_back (install_dir);
args.push_back (options.server_path);
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
// must use sync mode on windows
args.push_back ("-S");
args.push_back ("-v");
}
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
if (options.temporary) {
args.push_back ("-T");
}
ostringstream oss;
for (vector<string>::const_iterator i = args.begin(); i != args.end();) {
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
oss << quote_string (*i);
#else
oss << *i;
bool
ARDOUR::start_jack_server (const string& command_line)
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
STARTUPINFO si;
PROCESS_INFORMATION pi;
char * cmdline = g_strdup (command_line.c_str());
spath += ardour_dll_directory ();
spath.add_subdirectory_to_paths (ladspa_dir_name);
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
spath.push_back ("/usr/local/lib64/ladspa");
spath.push_back ("/usr/local/lib/ladspa");
spath.push_back ("/usr/lib64/ladspa");
vector<string *> *plugin_objects = scanner (ARDOUR::lv2_bundled_search_path().to_string(), lv2_filter, 0, true, true);
if (plugin_objects) {
for ( vector<string *>::iterator x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
-#ifdef WINDOWS
+#ifdef PLATFORM_WINDOWS
string uri = "file:///" + **x + "/";
#else
string uri = "file://" + **x + "/";
if (ioc & IO_IN) {
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
CrossThreadChannel::drain (port->selectable());
#endif
#include "libardour-config.h"
#endif
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
#include <jack/weakjack.h> // so that we can test for new functions at runtime
#endif
bool
PortInsert::configure_io (ChanCount in, ChanCount out)
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
assert (!AudioEngine::instance()->process_lock().trylock());
#endif
using namespace ARDOUR;
using namespace PBD;
+#ifdef PLATFORM_WINDOWS
+const uint32_t ResampledImportableSource::blocksize = 524288U;
+#else
const uint32_t ResampledImportableSource::blocksize = 16384U;
+#endif
ResampledImportableSource::ResampledImportableSource (boost::shared_ptr<ImportableSource> src, framecnt_t rate, SrcQuality srcq)
: source (src)
int
Route::configure_processors (ProcessorStreams* err)
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
assert (!AudioEngine::instance()->process_lock().trylock());
#endif
int
Route::configure_processors_unlocked (ProcessorStreams* err)
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
assert (!AudioEngine::instance()->process_lock().trylock());
#endif
#include <sys/stat.h>
+#ifdef PLATFORM_WINDOWS
+#include <glibmm/convert.h>
+#endif
#include <glibmm/miscutils.h>
#include "ardour/sndfilesource.h"
int
SndFileSource::open ()
{
- _descriptor = new SndFileDescriptor (_path, writable(), &_info);
+ string path_to_open;
+
+#ifdef PLATFORM_WINDOWS
+ path_to_open = Glib::locale_from_utf8(_path);
+#else
+ path_to_open = _path;
+#endif
+
+ _descriptor = new SndFileDescriptor (path_to_open.c_str(), writable(), &_info);
_descriptor->Closed.connect_same_thread (file_manager_connection, boost::bind (&SndFileSource::file_closed, this));
SNDFILE* sf = _descriptor->allocate ();
if (sf == 0) {
- char errbuf[256];
+ char errbuf[1024];
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
#ifndef HAVE_COREAUDIO
/* if we have CoreAudio, we will be falling back to that if libsndfile fails,
so we don't want to see this message.
*/
- cerr << "failed to open " << _path << " with name " << _name << endl;
+ cerr << "failed to open " << path_to_open << " with name " << _name << endl;
error << string_compose(_("SndFileSource: cannot open file \"%1\" for %2 (%3)"),
- _path, (writable() ? "read+write" : "reading"), errbuf) << endmsg;
+ path_to_open, (writable() ? "read+write" : "reading"), errbuf) << endmsg;
#endif
return -1;
}
if (!_broadcast_info->write_to_file (sf)) {
error << string_compose (_("cannot set broadcast info for audio file %1 (%2); dropping broadcast info for this file"),
- _path, _broadcast_info->get_error())
+ path_to_open, _broadcast_info->get_error())
<< endmsg;
_flags = Flag (_flags & ~Broadcast);
delete _broadcast_info;
#include <stdexcept>
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
#include <windows.h> // only for Sleep
#endif
void
JackUtilsTest::test_start_server ()
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
cout << endl;
JackCommandLineOptions options;
PBD::SearchPath
test_search_path ()
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
std::string wsp(g_win32_get_package_installation_directory_of_module(NULL));
return Glib::build_filename (wsp, "ardour_testdata");
#else