| Copyright | (c) 2012--2014, Utrecht University |
|---|---|
| License | LGPL-3 |
| Maintainer | W. Bas de Haas <w.b.dehaas@uu.nl> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell98 |
ZMidi.IO.Common
Contents
Description
Summary: Some common IO utilities
- mapDirInDir :: (FilePath -> IO a) -> FilePath -> IO [a]
- mapDir :: (FilePath -> IO a) -> FilePath -> IO [a]
- mapDir_ :: (FilePath -> IO a) -> FilePath -> IO ()
- foldrDirInDir :: (FilePath -> b -> IO b) -> b -> FilePath -> IO b
- foldrDir :: (FilePath -> b -> IO b) -> b -> FilePath -> IO b
- readMidiFile :: FilePath -> IO MidiFile
- readMidiScoreSafe :: FilePath -> IO (Either String MidiScore)
- readQMidiScoreSafe :: FilePath -> IO (Either String QMidiScore)
- readMidiScore :: FilePath -> IO MidiScore
- readQMidiScore :: FilePath -> IO QMidiScore
- writeMidiScore :: MidiScore -> FilePath -> IO ()
- logDuplicates :: FilePath -> IO ()
- removeTrackLabels :: FilePath -> IO ()
- putErrStrLn :: String -> IO ()
- warning :: FilePath -> String -> IO ()
Mapping
mapDirInDir :: (FilePath -> IO a) -> FilePath -> IO [a] Source
Applies a function to every directory inside a specific directory
mapDir :: (FilePath -> IO a) -> FilePath -> IO [a] Source
Applies a function to every file/dir in a directory
mapDir_ :: (FilePath -> IO a) -> FilePath -> IO () Source
Applies a function to every file/dir in a directory, similar to mapDir,
but it discards the result of the evaluation
Folding
foldrDirInDir :: (FilePath -> b -> IO b) -> b -> FilePath -> IO b Source
Folds a function to every directory inside a specific directory
foldrDir :: (FilePath -> b -> IO b) -> b -> FilePath -> IO b Source
Folds a function to every file/dir in a directory
Reading and Writing
readQMidiScoreSafe :: FilePath -> IO (Either String QMidiScore) Source
Reads a MidiFile using readMidiScoreSafe, quantisees the result
and checks if the MidiScore has a reasonable average quantisation deviation
(see QDevPerc)
readMidiScore :: FilePath -> IO MidiScore Source
readQMidiScore :: FilePath -> IO QMidiScore Source
Reads a MidiFile using readMidiScore but quantisees the result.
Utilities
logDuplicates :: FilePath -> IO () Source
Reads all midifiles at a specific location and compares all files to all files, printing the paths of the files with the same MIDI content to the user
removeTrackLabels :: FilePath -> IO () Source
Removes the Track labels from a MidiFile
putErrStrLn :: String -> IO () Source
Prints a string to the standard error stream