|
static IEnumerable< string > | GetDataFiles (string dataDirectory) |
| Get a list of all data files in sub directory of os data directory More...
|
|
static string | PathForDataFile (string dataDirectory, string fileName) |
| Returns the full path for specified datafile in a data directory More...
|
|
static string | PathForDataDirectory (string dataDirectory) |
| Returns the full path to the dataDirectory directory. More...
|
|
static bool | DataDirectoryExists (string dataDirectory) |
|
static string | PathForDataSubDirectory (params string[] dataDirectories) |
| Returns the full path to the dataDirectories directory. More...
|
|
static string | NextAvailableFilePath (string filepath) |
| Returns an available filepath. Appends " (#)" to the filename, incrementing # until it is available, starting with any modifier present in the filepath. More...
|
|
|
static string | GetCleanFileName (string fileName, out int modifierValue) |
| Identifies any filename matching the pattern "NameStuffHere (3)" and strips off and spits out the modifier More...
|
|
Definition at line 7 of file DataManagement.cs.
◆ DataDirectoryExists()
static bool BGC.IO.DataManagement.DataDirectoryExists |
( |
string |
dataDirectory | ) |
|
|
static |
◆ GetCleanFileName()
static string BGC.IO.DataManagement.GetCleanFileName |
( |
string |
fileName, |
|
|
out int |
modifierValue |
|
) |
| |
|
inlinestaticprivate |
Identifies any filename matching the pattern "NameStuffHere (3)" and strips off and spits out the modifier
Definition at line 82 of file DataManagement.cs.
85 if (fileName.EndsWith(
")") && fileName.Contains(
" ("))
90 int indexOfOpen = fileName.LastIndexOf(
" (");
91 int indexOfClose = fileName.LastIndexOf(
")");
93 int indexInside = indexOfOpen + 2;
94 int length = indexOfClose - indexInside;
100 string valueString = fileName.Substring(indexInside, length);
104 if (
int.TryParse(valueString, out modifierValue))
108 if (modifierValue > 0)
111 return fileName.Substring(0, indexOfOpen);
◆ GetDataFiles()
static IEnumerable<string> BGC.IO.DataManagement.GetDataFiles |
( |
string |
dataDirectory | ) |
|
|
static |
◆ NextAvailableFilePath()
static string BGC.IO.DataManagement.NextAvailableFilePath |
( |
string |
filepath | ) |
|
|
inlinestatic |
Returns an available filepath. Appends " (#)" to the filename, incrementing # until it is available, starting with any modifier present in the filepath.
- Returns
- An available filepath
Definition at line 127 of file DataManagement.cs.
Referenced by BGC.Audio.Midi.MidiEncoding.SaveFile().
129 if (!File.Exists(filepath))
134 string directory = Path.GetDirectoryName(filepath);
135 string fileExtension = Path.GetExtension(filepath);
137 fileName: Path.GetFileNameWithoutExtension(filepath),
138 modifierValue: out
int initialModifierValue);
140 for (
int i = initialModifierValue; ; i++)
142 if (!File.Exists(filepath))
147 filepath = Path.Combine(directory, $
"{fileName} ({i}){fileExtension}");
static string GetCleanFileName(string fileName, out int modifierValue)
Identifies any filename matching the pattern "NameStuffHere (3)" and strips off and spits out the mod...
◆ PathForDataDirectory()
static string BGC.IO.DataManagement.PathForDataDirectory |
( |
string |
dataDirectory | ) |
|
|
inlinestatic |
◆ PathForDataFile()
static string BGC.IO.DataManagement.PathForDataFile |
( |
string |
dataDirectory, |
|
|
string |
fileName |
|
) |
| |
|
static |
Returns the full path for specified datafile in a data directory
Referenced by BGC.Tests.SynthesisTests.FMTestBell(), BGC.Tests.SynthesisTests.FMTestBrass(), BGC.Tests.SynthesisTests.FMTestDrum(), BGC.Tests.SynthesisTests.FMTestOvertones(), BGC.Tests.SynthesisTests.FMTestPiano(), BGC.Tests.SynthesisTests.FMTestTrianglePiano(), BGC.Audio.Spatial.GetFilterFilename(), BGC.Audio.Calibration.Initialize(), BGC.Audio.Spatialization.ImpulseExtraction.PrepareRun(), BGC.Audio.Calibration.Serialize(), BGC.Tests.SynthesisTests.SmallAnalyticFMTest(), BGC.Tests.SynthesisTests.SmallSineFMTest(), BGC.Tests.SynthesisTests.SynthTestSnare(), BGC.Tests.SynthesisTests.TestAllPassFilterSpeech(), BGC.Tests.SynthesisTests.TestBiQuadFilters(), BGC.Tests.TestOverlapAdd.TestCarlileShuffler(), BGC.Tests.SynthesisTests.TestCarrierModifiedFakeVoices(), BGC.Tests.MidiEncodingTests.TestContinuousFilter(), BGC.Tests.WAVEncodingTests.TestDualChannelWave(), BGC.Tests.SynthesisTests.TestFakeVoice(), BGC.Tests.SynthesisTests.TestFDComposer(), BGC.Tests.SynthesisTests.TestFDComposerPure(), BGC.Tests.MidiEncodingTests.TestFlute(), BGC.Tests.SynthesisTests.TestFMFilterVoice(), BGC.Tests.SynthesisTests.TestFrequencyShifter(), BGC.Tests.SynthesisTests.TestFunFakeVoice(), BGC.Tests.MidiEncodingTests.TestGuitar(), BGC.Tests.MidiEncodingTests.TestHiHat(), BGC.Tests.MidiEncodingTests.TestLoadSaveMidiBare(), BGC.Tests.MidiEncodingTests.TestLoadSaveMidiFull(), BGC.Tests.TestOverlapAdd.TestNewConvolution(), BGC.Tests.TestOverlapAdd.TestNewSpatialization(), BGC.Tests.MidiEncodingTests.TestOrgan(), BGC.Tests.SynthesisTests.TestPhaseReEncoder(), BGC.Tests.TestOverlapAdd.TestPhaseVocoding(), BGC.Tests.MidiEncodingTests.TestPulses(), BGC.Tests.MidiEncodingTests.TestRenderMidi(), BGC.Tests.MidiEncodingTests.TestRenderToccataMidi(), BGC.Tests.SynthesisTests.TestSawtoothWave(), BGC.Tests.SynthesisTests.TestSineWave(), BGC.Tests.WAVEncodingTests.TestSingleChannelWave(), BGC.Tests.MidiEncodingTests.TestSnare(), BGC.Tests.SynthesisTests.TestSquareWave(), BGC.Tests.SynthesisTests.TestSTM(), BGC.Tests.SynthesisTests.TestTriangleWave(), BGC.Tests.ZipTests.TestZip(), BGC.Tests.SynthesisTests.TryAllPassFilter(), BGC.Tests.SynthesisTests.TryFMFilter(), and BGC.Tests.WAVEncodingTests.UpScalingTest().
◆ PathForDataSubDirectory()
static string BGC.IO.DataManagement.PathForDataSubDirectory |
( |
params string [] |
dataDirectories | ) |
|
|
inlinestatic |
Returns the full path to the dataDirectories directory.
Definition at line 57 of file DataManagement.cs.
Referenced by BGC.Tests.ZipTests.TestZip().
59 string[] paths =
new string[dataDirectories.Length + 1];
62 sourceArray: dataDirectories,
64 destinationArray: paths,
66 length: dataDirectories.Length);
68 string path = Path.Combine(paths);
70 if (Directory.Exists(path) ==
false)
72 Directory.CreateDirectory(path);
static string RootDirectory
Root directory for all users data
◆ rootDirectory
string BGC.IO.DataManagement.rootDirectory = null |
|
staticprivate |
◆ RootDirectory
string BGC.IO.DataManagement.RootDirectory |
|
staticget |
The documentation for this class was generated from the following file: