mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 13:46:30 +01:00
enable packaging for OSX native without jack; use which_page() everywhere in NSD; fix bad use of set_filename() in NSD; do not offer non-duplex devices in ardour's own audio setup dialog
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2896 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
cec81ceb3c
commit
5c3ba06c8d
5 changed files with 104 additions and 35 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <map>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm/messagedialog.h>
|
||||
#include <pbd/xml++.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
|
@ -621,10 +622,29 @@ EngineControl::enumerate_coreaudio_devices ()
|
|||
// Look for the CoreAudio device name...
|
||||
char coreDeviceName[256];
|
||||
size_t nameSize;
|
||||
|
||||
for (int i = 0; i < numCoreDevices; i++) {
|
||||
|
||||
nameSize = sizeof (coreDeviceName);
|
||||
|
||||
/* enforce duplex devices only */
|
||||
|
||||
err = AudioDeviceGetPropertyInfo(coreDeviceIDs[i],
|
||||
0, true, kAudioDevicePropertyStreams,
|
||||
&outSize, &isWritable);
|
||||
|
||||
if (err != noErr || outSize == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
err = AudioDeviceGetPropertyInfo(coreDeviceIDs[i],
|
||||
0, false, kAudioDevicePropertyStreams,
|
||||
&outSize, &isWritable);
|
||||
|
||||
if (err != noErr || outSize == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
err = AudioDeviceGetPropertyInfo(coreDeviceIDs[i],
|
||||
0, true, kAudioDevicePropertyDeviceName,
|
||||
&outSize, &isWritable);
|
||||
|
|
@ -649,6 +669,26 @@ EngineControl::enumerate_coreaudio_devices ()
|
|||
delete [] coreDeviceIDs;
|
||||
}
|
||||
|
||||
if (devs.size() == 0) {
|
||||
MessageDialog msg (_("\
|
||||
You do not have any audio devices capable of\n\
|
||||
simultaneous playback and recording.\n\n\
|
||||
Please use Applications -> Utilities -> Audio MIDI Setup\n\
|
||||
to create an \"aggregrate\" device, or install a suitable\n\
|
||||
audio interface.\n\n\
|
||||
Please send email to Apple and ask them why new Macs\n\
|
||||
have no duplex audio device.\n\n\
|
||||
Alternatively, if you really want just playback\n\
|
||||
or recording but not both, start JACK before running\n\
|
||||
Ardour and choose the relevant device then."
|
||||
),
|
||||
true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK);
|
||||
msg.set_title (_("No suitable audio devices"));
|
||||
msg.set_position (Gtk::WIN_POS_MOUSE);
|
||||
msg.run ();
|
||||
exit (1);
|
||||
}
|
||||
|
||||
return devs;
|
||||
}
|
||||
#else
|
||||
|
|
@ -863,7 +903,7 @@ EngineControl::find_jack_servers (vector<string>& strings)
|
|||
std::map<string,int> un;
|
||||
|
||||
path = getenv ("PATH");
|
||||
|
||||
|
||||
jack_servers = scanner (path, jack_server_filter, 0, false, true);
|
||||
|
||||
vector<string *>::iterator iter;
|
||||
|
|
@ -877,7 +917,6 @@ EngineControl::find_jack_servers (vector<string>& strings)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
string
|
||||
EngineControl::get_device_name (const string& driver, const string& human_readable)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
#include "i18n.h"
|
||||
#include "new_session_dialog.h"
|
||||
|
||||
#include <pbd/error.h>
|
||||
|
||||
#include <ardour/recent_sessions.h>
|
||||
#include <ardour/session.h>
|
||||
#include <ardour/profile.h>
|
||||
|
|
@ -36,6 +38,7 @@
|
|||
#include <gtkmm2ext/window_title.h>
|
||||
|
||||
using namespace Gtkmm2ext;
|
||||
using namespace PBD;
|
||||
|
||||
#include "opts.h"
|
||||
#include "utils.h"
|
||||
|
|
@ -557,40 +560,46 @@ NewSessionDialog::session_name() const
|
|||
}
|
||||
*/
|
||||
|
||||
int page = m_notebook->get_current_page();
|
||||
|
||||
if (page == 0 || page == 2) {
|
||||
switch (which_page()) {
|
||||
case NewPage:
|
||||
case EnginePage:
|
||||
/* new or audio setup pages */
|
||||
return Glib::filename_from_utf8(m_name->get_text());
|
||||
} else {
|
||||
if (m_treeview->get_selection()->count_selected_rows() == 0) {
|
||||
return Glib::filename_from_utf8(str);
|
||||
}
|
||||
Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected();
|
||||
return (*i)[recent_columns.visible_name];
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_treeview->get_selection()->count_selected_rows() == 0) {
|
||||
return Glib::filename_from_utf8(str);
|
||||
}
|
||||
Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected();
|
||||
return (*i)[recent_columns.visible_name];
|
||||
}
|
||||
|
||||
std::string
|
||||
NewSessionDialog::session_folder() const
|
||||
{
|
||||
if (m_notebook->get_current_page() == 0) {
|
||||
switch (which_page()) {
|
||||
case NewPage:
|
||||
return Glib::filename_from_utf8(m_folder->get_filename());
|
||||
} else {
|
||||
|
||||
if (m_treeview->get_selection()->count_selected_rows() == 0) {
|
||||
const string filename(Glib::filename_from_utf8(m_open_filechooser->get_filename()));
|
||||
return Glib::path_get_dirname(filename);
|
||||
}
|
||||
Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected();
|
||||
return (*i)[recent_columns.fullpath];
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_treeview->get_selection()->count_selected_rows() == 0) {
|
||||
const string filename(Glib::filename_from_utf8(m_open_filechooser->get_filename()));
|
||||
return Glib::path_get_dirname(filename);
|
||||
}
|
||||
|
||||
Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected();
|
||||
return (*i)[recent_columns.fullpath];
|
||||
}
|
||||
|
||||
bool
|
||||
NewSessionDialog::use_session_template() const
|
||||
{
|
||||
if(m_template->get_filename().empty() && (m_notebook->get_current_page() == 0)) return false;
|
||||
if(m_template->get_filename().empty() && (which_page() == NewPage)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -679,7 +688,7 @@ NewSessionDialog::get_current_page()
|
|||
}
|
||||
|
||||
NewSessionDialog::Pages
|
||||
NewSessionDialog::which_page ()
|
||||
NewSessionDialog::which_page () const
|
||||
{
|
||||
int num = m_notebook->get_current_page();
|
||||
|
||||
|
|
@ -902,7 +911,7 @@ NewSessionDialog::monitor_bus_button_clicked ()
|
|||
void
|
||||
NewSessionDialog::reset_template()
|
||||
{
|
||||
m_template->set_filename("");
|
||||
m_template->unselect_all ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public:
|
|||
|
||||
bool connect_outs_to_master() const;
|
||||
bool connect_outs_to_physical() const ;
|
||||
Pages which_page ();
|
||||
Pages which_page () const;
|
||||
|
||||
int get_current_page();
|
||||
void set_current_page (int);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __ardour_svn_revision_h__
|
||||
#define __ardour_svn_revision_h__
|
||||
static const char* ardour_svn_revision = "2882";
|
||||
static const char* ardour_svn_revision = "2884";
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ while [ $# -gt 0 ] ; do
|
|||
case $1 in
|
||||
--sae) SAE=1 ; shift ;;
|
||||
--nojack) WITH_JACK= ; shift ;;
|
||||
--noladpsa) WITH_LADSPA= ; shift ;;
|
||||
--noladspa) WITH_LADSPA= ; shift ;;
|
||||
--nostrip) STRIP= ; shift ;;
|
||||
--sysdeps) PRINT_SYSDEPS=1; shift ;;
|
||||
esac
|
||||
|
|
@ -76,6 +76,8 @@ fi
|
|||
|
||||
if test x$WITH_JACK != x ; then
|
||||
env="$env<key>ARDOUR_WITH_JACK</key><string>true</string>"
|
||||
else
|
||||
env="$env<key>PATH</key><string>/usr/local/bin:/opt/bin</string>"
|
||||
fi
|
||||
|
||||
env="<key>LSEnvironment</key><dict><key>ARDOUR_BUNDLED</key><string>true</string>$env</dict>"
|
||||
|
|
@ -142,7 +144,12 @@ while [ true ] ; do
|
|||
if ! file $file | grep -qs Mach-O ; then
|
||||
continue
|
||||
fi
|
||||
deps=`otool -L $file | awk '{print $1}' | egrep "($GTKQUARTZ_ROOT|/local/|libs/)"`
|
||||
if test x$WITH_JACK != x ; then
|
||||
deps=`otool -L $file | awk '{print $1}' | egrep "($GTKQUARTZ_ROOT|/local/|libs/)"`
|
||||
else
|
||||
# do not include libjack
|
||||
deps=`otool -L $file | awk '{print $1}' | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | grep -v 'libjack\.'`
|
||||
fi
|
||||
echo -n "."
|
||||
for dep in $deps ; do
|
||||
base=`basename $dep`
|
||||
|
|
@ -198,10 +205,17 @@ fi
|
|||
for exe in $executables; do
|
||||
EXE=$APPROOT/MacOS/$exe
|
||||
changes=""
|
||||
for lib in `otool -L $EXE | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}'` ; do
|
||||
base=`basename $lib`
|
||||
changes="$changes -change $lib @executable_path/../Frameworks/$base"
|
||||
done
|
||||
if test x$WITH_JACK != x ; then
|
||||
for lib in `otool -L $EXE | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}'` ; do
|
||||
base=`basename $lib`
|
||||
changes="$changes -change $lib @executable_path/../Frameworks/$base"
|
||||
done
|
||||
else
|
||||
for lib in `otool -L $EXE | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
|
||||
base=`basename $lib`
|
||||
changes="$changes -change $lib @executable_path/../Frameworks/$base"
|
||||
done
|
||||
fi
|
||||
if test "x$changes" != "x" ; then
|
||||
install_name_tool $changes $EXE
|
||||
fi
|
||||
|
|
@ -216,10 +230,17 @@ for dylib in $Frameworks/*.dylib $Frameworks/modules/*.so ; do
|
|||
# change all the dependencies
|
||||
|
||||
changes=""
|
||||
for lib in `otool -L $dylib | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}'` ; do
|
||||
base=`basename $lib`
|
||||
changes="$changes -change $lib @executable_path/../Frameworks/$base"
|
||||
done
|
||||
if test x$WITH_JACK != x ; then
|
||||
for lib in `otool -L $dylib | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}'` ; do
|
||||
base=`basename $lib`
|
||||
changes="$changes -change $lib @executable_path/../Frameworks/$base"
|
||||
done
|
||||
else
|
||||
for lib in `otool -L $dylib | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
|
||||
base=`basename $lib`
|
||||
changes="$changes -change $lib @executable_path/../Frameworks/$base"
|
||||
done
|
||||
fi
|
||||
|
||||
if test "x$changes" != x ; then
|
||||
if install_name_tool $changes $dylib ; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue