]> git.ayabusa.dev Git - rusty-slicer.git/commitdiff
added file format support
authorayabusa <lebgpub@gmail.com>
Sun, 3 Mar 2024 16:33:22 +0000 (17:33 +0100)
committerayabusa <lebgpub@gmail.com>
Sun, 3 Mar 2024 16:33:22 +0000 (17:33 +0100)
src-tauri/src/main.rs
src/index.html
src/main.js
src/stars.scss [deleted file]

index a8b241cf0f0f13f79faaf022f1b31b8fd4d974b6..a667aaf41bcccc8faaf77b69703926354121d12c 100644 (file)
@@ -35,7 +35,7 @@ async fn select_folder_button(app: tauri::AppHandle) {
 }
 
 #[tauri::command]
-async fn slice_button(app: tauri::AppHandle, chapter: String){
+async fn slice_button(app: tauri::AppHandle, chapter: String, fileformat: String){
     // Try to format the chapters and panic if it was not able to
     let formated_chapters = match format_chapter(&chapter) {
         Ok(res) => res,
@@ -63,9 +63,10 @@ async fn slice_button(app: tauri::AppHandle, chapter: String){
 
     for i in 0..time_codes.len(){
         let args: Vec<String>;
+        // create the path to the output file
         let mut output_file: PathBuf = PathBuf::from(&FOLDER_PATH.lock().unwrap().to_owned());
         output_file.push(format!("{:02} - {}", i+1, title_names[i]));
-        output_file.set_extension("mp3");
+        output_file.set_extension(&fileformat);
 
         if i+1<time_codes.len() {
             args = vec!["-i".to_owned(), 
@@ -74,6 +75,7 @@ async fn slice_button(app: tauri::AppHandle, chapter: String){
                 time_codes[i].to_owned(),
                 "-to".to_owned(),
                 time_codes[i+1].to_owned(),
+                "-vn".to_owned(), // no video
                 //format!("{:?}", output_file),
                 output_file.display().to_string()];
         }else { // case for the last song
@@ -81,6 +83,7 @@ async fn slice_button(app: tauri::AppHandle, chapter: String){
                 FILE_PATH.lock().unwrap().to_owned(),
                 "-ss".to_owned(),
                 time_codes[i].to_owned(),
+                "-vn".to_owned(), // no video
                 //format!("{:?}", output_file),
                 output_file.display().to_string()];
         }
index bdf1a27b357a5586221cd237839652ebfd400f6a..caa0da7ec5f17f7a06d38002915b2df0ed2d9851 100644 (file)
 
         <div class="select-file">
           <p><b> output type </b></p>
-          <select>
-            <option value="mp3">mp3</option>
+          <select id="fileFormatSelect">
+            <option value="mp3">mp3 (recommended)</option>
             <option value="ogg">ogg</option>
-            <option value="flac">flac</option>
+            <option value="flac">flac (really long)</option>
             <option value="m4a">m4a</option>
           </select>
         </div>
index 6264076e73d0830ada3c39fccc01e7dca55d8fe2..de17f8012e42e354bd2fb93ebce80f35a7456e60 100644 (file)
@@ -11,7 +11,7 @@ function select_folder_button_pressed(){
 }
 
 function slice_button_pressed(){
-    invoke("slice_button", {chapter: document.getElementById("chapterList").value})
+    invoke("slice_button", {chapter: document.getElementById("chapterList").value, fileformat: document.getElementById("fileFormatSelect").value})
 }
 
 function about_button_pressed(){
diff --git a/src/stars.scss b/src/stars.scss
deleted file mode 100644 (file)
index 3b4dc91..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-@mixin translate50
-{
-  -webkit-transform: translate(-50, -50%);
-  -ms-transform: translate(-50, -50%);
-  -o-transform: translate(-50, -50%);
-  transform: translate(-50, -50%);
-}
-
-@mixin roundedCorners
-{
-  -webkit-border-radius: 50%; 
-  -moz-border-radius: 50%; 
-  border-radius: 50%;
-}
-
-@mixin rotateBase
-{
-  -webkit-transform: rotate3d(-1, 1, 0, 0deg);
-  -ms-transform: rotate3d(-1, 1, 0, 0deg);
-  -o-transform: rotate3d(-1, 1, 0, 0deg);
-  transform: rotate3d(-1, 1, 0, 0deg);
-}
-
-@mixin rotateRight
-{
-  -webkit-transform: rotate3d(-1, 1, 0, 30deg);
-  -ms-transform: rotate3d(-1, 1, 0, 30deg);
-  -o-transform: rotate3d(-1, 1, 0, 30deg);
-  transform: rotate3d(-1, 1, 0, 30deg);
-}
-
-@mixin rotateLeft
-{
-  -webkit-transform: rotate3d(-1, 1, 0, -30deg);
-  -ms-transform: rotate3d(-1, 1, 0, -30deg);
-  -o-transform: rotate3d(-1, 1, 0, -30deg);
-  transform: rotate3d(-1, 1, 0, -30deg);
-}
-
-// n is number of stars generated
-@function generateStars ($n)
-{ 
-  $value: '#{0} #{random(2000)}px #{random(2000)}px #FFF';
-
-  @for $i from 2 through $n
-  {
-    $value: '#{$value} , #{random(2000)}px #{random(2000)}px #FFF';
-  }
-
-  @return unquote($value);
-}
-
-$stars-small:  generateStars(700);
-$stars-medium: generateStars(200);
-$stars-big:    generateStars(100);
-
-body
-{
-  overflow: hidden;
-}
-
-#stars-container
-{
-  height: 200vh;
-  width: 200%;
-  background: radial-gradient(ellipse at bottom, #1B2735 0%, #191F24 100%);
-  overflow: hidden;
-  @include translate50;
-}
-    
-#stars
-{
-  width: 1px;
-  height: 1px;
-  background: transparent;
-  box-shadow: $stars-small;
-  animation : animateStars 28.5s ease-in-out infinite;
-  @include roundedCorners;
-
-  &::after
-  {
-    content: " ";
-    position: absolute;
-    margin: auto;
-    top: 0; left: 0; right: 0; bottom: 0;
-    width: 1px;
-    height: 1px;
-    background: transparent;
-    box-shadow: $stars-small;
-    @include roundedCorners;
-  }
-}
-    
-#stars2
-{
-  width: 2px;
-  height: 2px;
-  background: transparent;
-  box-shadow: $stars-medium;
-  animation : animateStars 30s ease-in-out infinite;
-  @include roundedCorners;
-    
-  &::after
-  {
-    content: " ";
-    position: absolute;
-    margin: auto;
-    top: 0; left: 0; right: 0; bottom: 0;
-    width: 2px;
-    height: 2px;
-    background: transparent;
-    box-shadow: $stars-medium;
-    @include roundedCorners;
-  }
-}
-    
-#stars3
-{
-  width: 3px;
-  height: 3px;
-  background: transparent;
-  box-shadow: $stars-big;
-  animation : animateStars 31.5s ease-in-out infinite;
-  @include roundedCorners;
-    
-  &:after
-  {
-    content: " ";
-    position: absolute;
-    margin: auto;
-    top: 0; left: 0; right: 0; bottom: 0;
-    width: 3px;
-    height: 3px;
-    background: transparent;
-    box-shadow: $stars-big;
-    @include roundedCorners;
-  }
-}
-
-@keyframes animateStars
-{
-  0%{@include rotateBase;}
-  25%{@include rotateRight;}
-  50%{@include rotateBase;}
-  75%{@include rotateLeft;}
-  100%{@include rotateBase;}
-}
\ No newline at end of file