1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-12 06:37:52 +02:00

Experimental Nyquist time/date property (idefed out).

This commit is contained in:
stevethefiddle@gmail.com 2014-12-25 18:22:59 +00:00
parent 5b8747c636
commit 9f5f5e36ad
2 changed files with 33 additions and 0 deletions

View File

@ -200,4 +200,7 @@
// Define to enable Nyquist audio clip boundary control (Steve Daulton Dec 2014)
// #define EXPERIMENTAL_NYQUIST_SPLIT_CONTROL
// Define to enable Nyquist time/date property list
// #define EXPERIMENTAL_NYQUIST_TIME_PROPERTY
#endif

View File

@ -50,6 +50,10 @@ effects from this one class.
#include <wx/choice.h>
#include <wx/checkbox.h>
#if defined EXPERIMENTAL_NYQUIST_TIME_PROPERTY
#include <wx/datetime.h>
#endif
#include "../../AudacityApp.h"
#include "../../FileNames.h"
#include "../../Internat.h"
@ -515,6 +519,32 @@ bool EffectNyquist::Process()
}
mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* (list %s) 'PLUGIN)\n"), list.RemoveLast().c_str());
#if defined EXPERIMENTAL_NYQUIST_TIME_PROPERTY
// Date and time:
wxDateTime now = wxDateTime::Now();
int year = now.GetYear();
int doy = now.GetDayOfYear();
int dom = now.GetDay();
// enumerated constants
wxDateTime::Month month = now.GetMonth();
wxDateTime::WeekDay day = now.GetWeekDay();
// Date/time as a list: year, day of year, hour, minute, seconds
mProps += wxString::Format(wxT("(setf *SYSTEM-TIME* (list %d %d %d %d %d))\n"),
year, doy, now.GetHour(), now.GetMinute(), now.GetSecond());
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'DATE)\n"), now.FormatDate().c_str());
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'TIME)\n"), now.FormatTime().c_str());
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'ISO-DATE)\n"), now.FormatISODate().c_str());
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'ISO-TIME)\n"), now.FormatISOTime().c_str());
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* %d 'YEAR)\n"), year);
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* %d 'DAY)\n"), dom); // day of month
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* %d 'MONTH)\n"), month);
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'MONTH-NAME)\n"), now.GetMonthName(month).c_str());
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'DAY-NAME)\n"), now.GetWeekDayName(day).c_str());
#endif
TrackListIterator all(project->GetTracks());
Track *t;
int numTracks = 0;