projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tweak monitoring state logic
[ardour.git]
/
libs
/
ardour
/
tempo_map_importer.cc
diff --git
a/libs/ardour/tempo_map_importer.cc
b/libs/ardour/tempo_map_importer.cc
index 07e6dd06e41f5fdd826e6df80f56734e67fafcaa..b170aea8ea9a2bfb2389f227e383369335aafb4c 100644
(file)
--- a/
libs/ardour/tempo_map_importer.cc
+++ b/
libs/ardour/tempo_map_importer.cc
@@
-18,17
+18,18
@@
*/
*/
-#include
<ardour/tempo_map_importer.h>
+#include
"ardour/tempo_map_importer.h"
#include <sstream>
#include <sstream>
-#include
<ardour/session.h>
-#include
<pbd/failed_constructor.h>
-#include
<pbd/compose.h>
-#include
<pbd/error.h>
+#include
"ardour/session.h"
+#include
"pbd/failed_constructor.h"
+#include
"pbd/compose.h"
+#include
"pbd/error.h"
#include "i18n.h"
#include "i18n.h"
+using namespace std;
using namespace PBD;
using namespace ARDOUR;
using namespace PBD;
using namespace ARDOUR;
@@
-38,11
+39,11
@@
TempoMapImportHandler::TempoMapImportHandler (XMLTree const & source, Session &
{
XMLNode const * root = source.root();
XMLNode const * tempo_map;
{
XMLNode const * root = source.root();
XMLNode const * tempo_map;
-
+
if (!(tempo_map = root->child (X_("TempoMap")))) {
throw failed_constructor();
}
if (!(tempo_map = root->child (X_("TempoMap")))) {
throw failed_constructor();
}
-
+
elements.push_back (ElementPtr ( new TempoMapImporter (source, session, *tempo_map)));
}
elements.push_back (ElementPtr ( new TempoMapImporter (source, session, *tempo_map)));
}
@@
-53,7
+54,7
@@
TempoMapImportHandler::get_info () const
}
/*** TempoMapImporter ***/
}
/*** TempoMapImporter ***/
-TempoMapImporter::TempoMapImporter (XMLTree const & source, Session & session, XMLNode const & node) :
+TempoMapImporter::TempoMapImporter (XMLTree const & source, Session & session, XMLNode const & node) :
ElementImporter (source, session),
xml_tempo_map (node)
{
ElementImporter (source, session),
xml_tempo_map (node)
{
@@
-67,7
+68,7
@@
TempoMapImporter::get_info () const
unsigned int tempos = 0;
unsigned int meters = 0;
XMLNodeList children = xml_tempo_map.children();
unsigned int tempos = 0;
unsigned int meters = 0;
XMLNodeList children = xml_tempo_map.children();
-
+
for (XMLNodeIterator it = children.begin(); it != children.end(); it++) {
if ((*it)->name() == "Tempo") {
tempos++;
for (XMLNodeIterator it = children.begin(); it != children.end(); it++) {
if ((*it)->name() == "Tempo") {
tempos++;
@@
-75,10
+76,10
@@
TempoMapImporter::get_info () const
meters++;
}
}
meters++;
}
}
-
+
// return info
oss << _("Tempo marks: ") << tempos << _("\nMeter marks: ") << meters;
// return info
oss << _("Tempo marks: ") << tempos << _("\nMeter marks: ") << meters;
-
+
return oss.str();
}
return oss.str();
}
@@
-86,8
+87,8
@@
bool
TempoMapImporter::_prepare_move ()
{
// Prompt user for verification
TempoMapImporter::_prepare_move ()
{
// Prompt user for verification
- boo
l
replace = Prompt (_("This will replace the current tempo map!\nAre you shure you want to do this?"));
- return replace;
+ boo
st::optional<bool>
replace = Prompt (_("This will replace the current tempo map!\nAre you shure you want to do this?"));
+ return replace
.get_value_or (false)
;
}
void
}
void
@@
-98,5
+99,5
@@
TempoMapImporter::_cancel_move ()
void
TempoMapImporter::_move ()
{
void
TempoMapImporter::_move ()
{
- session.tempo_map().set_state (xml_tempo_map);
+ session.tempo_map().set_state (xml_tempo_map
, Stateful::current_state_version
);
}
}