-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
455 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,46 @@ | ||
use mizer_module::*; | ||
use crate::MediaServer; | ||
use mizer_module::*; | ||
|
||
impl ProjectHandler for MediaServer { | ||
fn get_name(&self) -> &'static str { | ||
"media" | ||
} | ||
|
||
fn new_project(&mut self, _context: &mut impl ProjectHandlerContext, _injector: &mut dyn InjectDynMut) -> anyhow::Result<()> { | ||
fn new_project( | ||
&mut self, | ||
_context: &mut impl ProjectHandlerContext, | ||
_injector: &mut dyn InjectDynMut, | ||
) -> anyhow::Result<()> { | ||
self.clear(); | ||
|
||
Ok(()) | ||
} | ||
|
||
fn load_project(&mut self, context: &mut impl LoadProjectContext, _injector: &mut dyn InjectDynMut) -> anyhow::Result<()> { | ||
fn load_project( | ||
&mut self, | ||
context: &mut impl LoadProjectContext, | ||
_injector: &mut dyn InjectDynMut, | ||
) -> anyhow::Result<()> { | ||
self.clear(); | ||
let files = context.read_file("files")?; | ||
self.import_files(files)?; | ||
let tags = context.read_file("tags")?; | ||
self.import_tags(tags)?; | ||
let watched_folders = context.read_file("watched_folders")?; | ||
self.set_import_paths(watched_folders); | ||
|
||
Ok(()) | ||
|
||
} | ||
|
||
fn save_project(&self, context: &mut impl SaveProjectContext, _injector: &dyn InjectDyn) -> anyhow::Result<()> { | ||
fn save_project( | ||
&self, | ||
context: &mut impl SaveProjectContext, | ||
_injector: &dyn InjectDyn, | ||
) -> anyhow::Result<()> { | ||
context.write_file("files", self.get_media()?)?; | ||
context.write_file("tags", self.get_tags()?)?; | ||
context.write_file("watched_folders", self.get_import_paths())?; | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.