using namespace ARDOUR;
using namespace std;
+using namespace PBD;
void
elapsed_time_to_str (char *buf, uint32_t seconds)
int
touch_file (string path)
{
- int fd = open (path.c_str(), O_RDONLY|O_CREAT);
+ int fd = open (path.c_str(), O_RDWR|O_CREAT, 0660);
if (fd >= 0) {
close (fd);
return 0;
return 1;
}
-uint32_t long
-get_uid()
-{
- struct timeval tv;
- gettimeofday(&tv, 0);
-
- return (uint32_t long) tv.tv_sec * 1000000 + tv.tv_usec;
-}
-
string
placement_as_string (Placement p)
{
#endif
}
+#ifdef HAVE_COREAUDIO
+string
+CFStringRefToStdString(CFStringRef stringRef)
+{
+ CFIndex size =
+ CFStringGetMaximumSizeForEncoding(CFStringGetLength(stringRef) ,
+ kCFStringEncodingUTF8);
+ char *buf = new char[size];
+
+ std::string result;
+
+ if(CFStringGetCString(stringRef, buf, size, kCFStringEncodingUTF8)) {
+ result = buf;
+ }
+ delete [] buf;
+ return result;
+}
+#endif // HAVE_COREAUDIO