From 74f760cf2c266193a639dec0508539cda96a971f Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 31 May 2021 15:26:11 -0600 Subject: [PATCH] WIP nap music --- projects/nap/ideas.txt | 2 ++ projects/nap/src/nap/Archive.kiss | 11 +++++++++++ projects/nap/src/nap/components/Dates.hx | 3 +++ projects/nap/src/nap/components/StringComponents.hx | 4 ++++ projects/nap/tools/nap-music/build.hxml | 5 +++++ projects/nap/tools/nap-music/src/Main.hx | 8 ++++++++ projects/nap/tools/nap-music/src/Main.kiss | 2 ++ 7 files changed, 35 insertions(+) create mode 100644 projects/nap/ideas.txt create mode 100644 projects/nap/src/nap/components/Dates.hx create mode 100644 projects/nap/src/nap/components/StringComponents.hx create mode 100644 projects/nap/tools/nap-music/build.hxml create mode 100644 projects/nap/tools/nap-music/src/Main.hx create mode 100644 projects/nap/tools/nap-music/src/Main.kiss diff --git a/projects/nap/ideas.txt b/projects/nap/ideas.txt new file mode 100644 index 00000000..05136d53 --- /dev/null +++ b/projects/nap/ideas.txt @@ -0,0 +1,2 @@ +program that helps you cobble together journal entries retroactively using your texts and message history from that day. and calendar etc +music player that youtubeDLs the songs you like, and will play songs by artists you like diff --git a/projects/nap/src/nap/Archive.kiss b/projects/nap/src/nap/Archive.kiss index 3f4edae0..4fd729b7 100644 --- a/projects/nap/src/nap/Archive.kiss +++ b/projects/nap/src/nap/Archive.kiss @@ -24,6 +24,17 @@ (system.checkEntryInOrOut this e)) e)) +(defmethod saveEntry [:Entry e] + (File.saveContent + (Path.join [archiveDir "entries" (e.id.withExtension "json")]) + (Json.stringify e)) + + // TODO save its components? but it's not obvious how, because it only knows the string keys of them. + // Better yet, retrieving components with mutable access should be done through a + // (withComponent...) macro that serializes the component after the block is done. + // + ) + (defun :Entry _newEntry [] (object id (Uuid.v4) diff --git a/projects/nap/src/nap/components/Dates.hx b/projects/nap/src/nap/components/Dates.hx new file mode 100644 index 00000000..2cc7ca84 --- /dev/null +++ b/projects/nap/src/nap/components/Dates.hx @@ -0,0 +1,3 @@ +package nap.components; + +typedef Tags = Map; diff --git a/projects/nap/src/nap/components/StringComponents.hx b/projects/nap/src/nap/components/StringComponents.hx new file mode 100644 index 00000000..84a33722 --- /dev/null +++ b/projects/nap/src/nap/components/StringComponents.hx @@ -0,0 +1,4 @@ +package nap.components; + +typedef Name = String; +typedef Author = String; diff --git a/projects/nap/tools/nap-music/build.hxml b/projects/nap/tools/nap-music/build.hxml new file mode 100644 index 00000000..9882eaaf --- /dev/null +++ b/projects/nap/tools/nap-music/build.hxml @@ -0,0 +1,5 @@ +-lib kiss +-lib nap +-cp src +--main Main +--interp \ No newline at end of file diff --git a/projects/nap/tools/nap-music/src/Main.hx b/projects/nap/tools/nap-music/src/Main.hx new file mode 100644 index 00000000..9832373f --- /dev/null +++ b/projects/nap/tools/nap-music/src/Main.hx @@ -0,0 +1,8 @@ +package; + +import kiss.Kiss; +import kiss.Prelude; +import nap.Archive; + +@:build(kiss.Kiss.build()) +class Main {} diff --git a/projects/nap/tools/nap-music/src/Main.kiss b/projects/nap/tools/nap-music/src/Main.kiss new file mode 100644 index 00000000..24b3c985 --- /dev/null +++ b/projects/nap/tools/nap-music/src/Main.kiss @@ -0,0 +1,2 @@ +(defun :Void main [] + (print "Hello world!")) \ No newline at end of file