diff options
author | John Emmas <johne53@tiscali.co.uk> | 2013-08-04 17:01:37 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2013-08-04 17:01:37 +0100 |
commit | d176cbc80476cdc8ca082631efc171ea39116d63 (patch) | |
tree | 16645ddb055c746ab92b8b1d2639ba8fcf5c433b | |
parent | 490311bc081b12d328e6e02cac8170538e96fb2f (diff) |
'libs/ardour' - Compiler specific includes and includes
-rw-r--r-- | libs/ardour/ardour/cycles.h | 3 | ||||
-rw-r--r-- | libs/ardour/audiosource.cc | 8 | ||||
-rw-r--r-- | libs/ardour/default_click.cc | 4 | ||||
-rw-r--r-- | libs/ardour/ladspa_plugin.cc | 2 | ||||
-rw-r--r-- | libs/ardour/pcm_utils.cc | 4 | ||||
-rw-r--r-- | libs/ardour/plugin.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 48 | ||||
-rw-r--r-- | libs/ardour/session_vst.cc | 10 | ||||
-rw-r--r-- | libs/ardour/sndfile_helpers.cc | 2 | ||||
-rw-r--r-- | libs/ardour/sse_functions_xmm.cc | 5 | ||||
-rw-r--r-- | libs/ardour/utils.cc | 2 |
11 files changed, 86 insertions, 4 deletions
diff --git a/libs/ardour/ardour/cycles.h b/libs/ardour/ardour/cycles.h index 01e1d55221..dc1095db7b 100644 --- a/libs/ardour/ardour/cycles.h +++ b/libs/ardour/ardour/cycles.h @@ -216,7 +216,10 @@ static inline cycles_t get_cycles (void) /* debian: sparc, arm, m68k */ +#ifndef COMPILER_MSVC +/* GRRR... Annoyingly, #warning aborts the compilation for MSVC !! */ #warning You are compiling libardour on a platform for which ardour/cycles.h needs work +#endif #include <sys/time.h> diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index f6ced35186..1dce801884 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -17,11 +17,15 @@ */ -#include <sys/stat.h> +#ifdef COMPILER_MSVC +#include <sys/utime.h> +#else #include <unistd.h> +#include <utime.h> +#endif +#include <sys/stat.h> #include <fcntl.h> #include <float.h> -#include <utime.h> #include <cerrno> #include <ctime> #include <cmath> diff --git a/libs/ardour/default_click.cc b/libs/ardour/default_click.cc index fd23f0166d..7e8eca8fd2 100644 --- a/libs/ardour/default_click.cc +++ b/libs/ardour/default_click.cc @@ -21,6 +21,10 @@ #include "ardour/session.h" #include "ardour/types.h" +#ifdef COMPILER_MSVC +#pragma warning(disable:4305) +#endif + using namespace ARDOUR; const Sample Session::default_click_emphasis[] = { diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index c78d8a28dd..78e16f9941 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -29,7 +29,9 @@ #include <cstdlib> #include <cstdio> // so libraptor doesn't complain #include <cmath> +#ifndef COMPILER_MSVC #include <dirent.h> +#endif #include <sys/stat.h> #include <cerrno> diff --git a/libs/ardour/pcm_utils.cc b/libs/ardour/pcm_utils.cc index de3497d977..ae3bd4a4e0 100644 --- a/libs/ardour/pcm_utils.cc +++ b/libs/ardour/pcm_utils.cc @@ -17,8 +17,10 @@ */ +#ifdef COMPILER_MSVC +#include <ardourext/float_cast.h> +#endif #include "ardour/pcm_utils.h" - #include <cmath> using namespace std; diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index 5e0e020bd1..11d859ed8c 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -27,7 +27,9 @@ #include <cstdlib> #include <cstdio> // so libraptor doesn't complain #include <cmath> +#ifndef COMPILER_MSVC #include <dirent.h> +#endif #include <sys/stat.h> #include <cerrno> #include <utility> diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 62edaa3911..80f1e87972 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2114,6 +2114,54 @@ Session::refresh_disk_space () _total_free_4k_blocks_uncertain = true; } } +#elif defined (COMPILER_MSVC) + vector<string> scanned_volumes; + vector<string>::iterator j; + vector<space_and_path>::iterator i; + DWORD nSectorsPerCluster, nBytesPerSector, + nFreeClusters, nTotalClusters; + char disk_drive[4]; + bool volume_found; + + _total_free_4k_blocks = 0; + + for (i = session_dirs.begin(); i != session_dirs.end(); i++) { + strncpy (disk_drive, (*i).path.c_str(), 3); + disk_drive[3] = 0; + strupr(disk_drive); + + volume_found = false; + if (0 != (GetDiskFreeSpace(disk_drive, &nSectorsPerCluster, &nBytesPerSector, &nFreeClusters, &nTotalClusters))) + { + int64_t nBytesPerCluster = nBytesPerSector * nSectorsPerCluster; + int64_t nFreeBytes = nBytesPerCluster * (int64_t)nFreeClusters; + i->blocks = (uint32_t)(nFreeBytes / 4096); + + for (j = scanned_volumes.begin(); j != scanned_volumes.end(); j++) { + if (0 == j->compare(disk_drive)) { + volume_found = true; + break; + } + } + + if (!volume_found) { + scanned_volumes.push_back(disk_drive); + _total_free_4k_blocks += i->blocks; + } + } + } + + if (0 == _total_free_4k_blocks) { + strncpy (disk_drive, path().c_str(), 3); + disk_drive[3] = 0; + + if (0 != (GetDiskFreeSpace(disk_drive, &nSectorsPerCluster, &nBytesPerSector, &nFreeClusters, &nTotalClusters))) + { + int64_t nBytesPerCluster = nBytesPerSector * nSectorsPerCluster; + int64_t nFreeBytes = nBytesPerCluster * (int64_t)nFreeClusters; + _total_free_4k_blocks = (uint32_t)(nFreeBytes / 4096); + } + } #endif } diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc index 644fb19ffb..06a6b80e99 100644 --- a/libs/ardour/session_vst.cc +++ b/libs/ardour/session_vst.cc @@ -17,7 +17,9 @@ */ +#ifndef COMPILER_MSVC #include <stdbool.h> +#endif #include <cstdio> #include "ardour/session.h" @@ -59,11 +61,19 @@ intptr_t Session::vst_callback ( if (effect && effect->user) { plug = (VSTPlugin *) (effect->user); session = &plug->session(); +#ifdef COMPILER_MSVC + SHOW_CALLBACK ("am callback 0x%x, opcode = %d, plugin = \"%s\" ", (int) pthread_self().p, opcode, plug->name()); +#else SHOW_CALLBACK ("am callback 0x%x, opcode = %d, plugin = \"%s\" ", (int) pthread_self(), opcode, plug->name()); +#endif } else { plug = 0; session = 0; +#ifdef COMPILER_MSVC + SHOW_CALLBACK ("am callback 0x%x, opcode = %d", (int) pthread_self().p, opcode); +#else SHOW_CALLBACK ("am callback 0x%x, opcode = %d", (int) pthread_self(), opcode); +#endif } switch(opcode){ diff --git a/libs/ardour/sndfile_helpers.cc b/libs/ardour/sndfile_helpers.cc index 459890e829..2e618e043b 100644 --- a/libs/ardour/sndfile_helpers.cc +++ b/libs/ardour/sndfile_helpers.cc @@ -17,7 +17,9 @@ */ +#ifndef COMPILER_MSVC #include <strings.h> +#endif #include <map> #include <sndfile.h> diff --git a/libs/ardour/sse_functions_xmm.cc b/libs/ardour/sse_functions_xmm.cc index 48212ea8e1..f8a53cc6f8 100644 --- a/libs/ardour/sse_functions_xmm.cc +++ b/libs/ardour/sse_functions_xmm.cc @@ -45,8 +45,11 @@ x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::pframes_t nframes, float * // use 64 byte prefetch for quadruple quads while (nframes >= 16) { +#ifdef COMPILER_MSVC + _mm_prefetch(((char*)buf+64), 0); // A total guess! Assumed to be eqivalent to +#else // the line below but waiting to be tested !! __builtin_prefetch(buf+64,0,0); - +#endif work = _mm_load_ps(buf); current_min = _mm_min_ps(current_min, work); current_max = _mm_max_ps(current_max, work); diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index e7b7648149..f23f1332b8 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -36,7 +36,9 @@ #include <sys/stat.h> #include <sys/time.h> #include <fcntl.h> +#ifndef COMPILER_MSVC #include <dirent.h> +#endif #include <errno.h> #include <regex.h> |