1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-13 22:21:11 +02:00

Fix compilation without USE_MIDI

This commit is contained in:
Alexander Tsoy
2019-08-27 19:12:43 +03:00
parent 45ddc8c413
commit 7a91b6c5e9
5 changed files with 10 additions and 10 deletions

View File

@@ -299,6 +299,7 @@ const ReservedCommandFlag
return !TrackList::Get( project ).Any<const WaveTrack>().empty(); return !TrackList::Get( project ).Any<const WaveTrack>().empty();
} }
}, },
#ifdef USE_MIDI
NoteTracksExistFlag{ NoteTracksExistFlag{
[](const AudacityProject &project){ [](const AudacityProject &project){
return !TrackList::Get( project ).Any<const NoteTrack>().empty(); return !TrackList::Get( project ).Any<const NoteTrack>().empty();
@@ -309,6 +310,7 @@ const ReservedCommandFlag
return !TrackList::Get( project ).Selected<const NoteTrack>().empty(); return !TrackList::Get( project ).Selected<const NoteTrack>().empty();
} }
}, //gsw }, //gsw
#endif
IsNotSyncLockedFlag{ IsNotSyncLockedFlag{
[](const AudacityProject &project){ [](const AudacityProject &project){
return !ProjectSettings::Get( project ).IsSyncLocked(); return !ProjectSettings::Get( project ).IsSyncLocked();
@@ -354,9 +356,11 @@ const ReservedCommandFlag
[](const AudacityProject &project){ [](const AudacityProject &project){
auto &tracks = TrackList::Get( project ); auto &tracks = TrackList::Get( project );
return return
#ifdef USE_MIDI
!tracks.Selected<const NoteTrack>().empty() !tracks.Selected<const NoteTrack>().empty()
// even if not EXPERIMENTAL_MIDI_OUT // even if not EXPERIMENTAL_MIDI_OUT
|| ||
#endif
!tracks.Selected<const WaveTrack>().empty() !tracks.Selected<const WaveTrack>().empty()
; ;
} }

View File

@@ -49,10 +49,6 @@ using WaveTrackConstArray = std::vector < std::shared_ptr < const WaveTrack > >;
using NoteTrackConstArray = std::vector < std::shared_ptr< const NoteTrack > >; using NoteTrackConstArray = std::vector < std::shared_ptr< const NoteTrack > >;
#if defined(USE_MIDI)
class NoteTrack;
#endif
class TrackList; class TrackList;
using ListOfTracks = std::list< std::shared_ptr< Track > >; using ListOfTracks = std::list< std::shared_ptr< Track > >;
@@ -70,9 +66,7 @@ enum class TrackKind
{ {
None, None,
Wave, Wave,
#if defined(USE_MIDI)
Note, Note,
#endif
Label, Label,
Time, Time,
Audio, Audio,

View File

@@ -276,6 +276,7 @@ static Importer::RegisteredImportPlugin registered{
std::make_unique< LOFImportPlugin >() std::make_unique< LOFImportPlugin >()
}; };
#ifdef USE_MIDI
// return null on failure; if success, return the given project, or a NEW // return null on failure; if success, return the given project, or a NEW
// one, if the given was null; create no NEW project if failure // one, if the given was null; create no NEW project if failure
static AudacityProject *DoImportMIDIProject( static AudacityProject *DoImportMIDIProject(
@@ -294,6 +295,7 @@ static AudacityProject *DoImportMIDIProject(
else else
return nullptr; return nullptr;
} }
#endif
/** @brief Processes a single line from a LOF text file, doing whatever is /** @brief Processes a single line from a LOF text file, doing whatever is
* indicated on the line. * indicated on the line.

View File

@@ -248,8 +248,6 @@ const TCPLines &NoteTrackControls::GetTCPLines() const
return noteTrackTCPLines; return noteTrackTCPLines;
}; };
#endif
namespace { namespace {
#ifdef EXPERIMENTAL_MIDI_OUT #ifdef EXPERIMENTAL_MIDI_OUT
@@ -329,3 +327,5 @@ auto GetDefaultNoteTrackHeight::Implementation() -> Function {
}; };
} }
static GetDefaultNoteTrackHeight registerGetDefaultNoteTrackHeight; static GetDefaultNoteTrackHeight registerGetDefaultNoteTrackHeight;
#endif

View File

@@ -396,12 +396,12 @@ UIHandle::Result TimeShiftHandle::Click
ok = false; ok = false;
else else
captureClips = true; captureClips = true;
},
#ifdef USE_MIDI #ifdef USE_MIDI
},
[&](NoteTrack *) { [&](NoteTrack *) {
captureClips = true; captureClips = true;
}
#endif #endif
}
); );
if ( ! ok ) if ( ! ok )