-- Copyright 2021 Evan Laforge
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or http://www.gnu.org/licenses/gpl-3.0.txt

module Perform.Sc.Patch (Patch(..), c_pitch) where
import qualified GHC.Generics as Generics

import qualified Util.Pretty as Pretty
import qualified Derive.ScoreT as ScoreT
import qualified Perform.Sc.Note as Note

import           Global


data Patch = Patch {
    Patch -> PatchName
name :: !Note.PatchName
    -- | Path to the scsyndef file.  This is needed to tell scserver to load
    -- it.
    , Patch -> FilePath
filename :: !FilePath
    , Patch -> Map Control ControlId
controls :: !(Map ScoreT.Control Note.ControlId)
    } deriving (Patch -> Patch -> Bool
(Patch -> Patch -> Bool) -> (Patch -> Patch -> Bool) -> Eq Patch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Patch -> Patch -> Bool
$c/= :: Patch -> Patch -> Bool
== :: Patch -> Patch -> Bool
$c== :: Patch -> Patch -> Bool
Eq, Int -> Patch -> ShowS
[Patch] -> ShowS
Patch -> FilePath
(Int -> Patch -> ShowS)
-> (Patch -> FilePath) -> ([Patch] -> ShowS) -> Show Patch
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [Patch] -> ShowS
$cshowList :: [Patch] -> ShowS
show :: Patch -> FilePath
$cshow :: Patch -> FilePath
showsPrec :: Int -> Patch -> ShowS
$cshowsPrec :: Int -> Patch -> ShowS
Show, (forall x. Patch -> Rep Patch x)
-> (forall x. Rep Patch x -> Patch) -> Generic Patch
forall x. Rep Patch x -> Patch
forall x. Patch -> Rep Patch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Patch x -> Patch
$cfrom :: forall x. Patch -> Rep Patch x
Generics.Generic)

instance Pretty.Pretty Patch where format :: Patch -> Doc
format = Patch -> Doc
forall a. (PrettyG (Rep a), Generic a) => a -> Doc
Pretty.formatG

c_pitch :: ScoreT.Control
c_pitch :: Control
c_pitch = Control
"pitch"