1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 16:09:28 +02:00

Add time and date property list.

This commit is contained in:
Steve Daulton 2015-04-14 13:50:51 +01:00
parent a6ab3bfc11
commit d8d292edc7
2 changed files with 32 additions and 0 deletions

View File

@ -49,6 +49,7 @@ effects from this one class.
#include <wx/textfile.h>
#include <wx/choice.h>
#include <wx/checkbox.h>
#include <wx/datetime.h>
#if defined EXPERIMENTAL_NYQUIST_TIME_PROPERTY
#include <wx/datetime.h>
@ -540,6 +541,30 @@ bool EffectNyquist::Process()
#endif
// 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());
TrackListIterator all(project->GetTracks());
Track *t;
int numTracks = 0;

View File

@ -701,6 +701,13 @@ int Importer::Import(wxString fName,
return 0;
}
// Audacity project
if (extension.IsSameAs(wxT("aup"), false)) {
errorMessage.Printf(_("\"%s\" is an Audacity Project file. \nUse the 'File > Open' command to open Audacity Projects."), fName.c_str());
pProj->mbBusyImporting = false;
return 0;
}
// we were not able to recognize the file type
errorMessage.Printf(_("Audacity did not recognize the type of the file '%s'.\nIf it is uncompressed, try importing it using \"Import Raw\"."),fName.c_str());
}