Skip to main content

Topic: foo_onewaysync (Read 29741 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Onewaysync exports playlists and their files to a MP3 player or any other windows path, including MTP devices. It supports on the fly conversion of audio files with various encoders.

Download

Current version: 0.6.1

Changes since 0.6.0:
- keep qaac happy when using multithreading

Changes since 0.5.11:
- show converter erros in console
- fixed embedded cover art
- embedding of folder based cover art

Known issues:
- unless they are converted, files with subsongs are not split during sync
- MTP devices: Tags of preexisting files are not updated, this is not a bug. Foobar can not access these files directly, therefore it is not possible to update tags without copying the entire file, which would be slow.


How do I use this component?
The component adds a context menu entry in 'File Operations' and a main menu entry in 'File'. For either of them to work properly you'll have to edit the components preferences:
- Configure the encoder setting, if you wish to transcode certain files. If you want to use lame you only need to correct the path to lame.exe in the default entry, double clicking it brings up the edit window.
- On the 'Devices' preference page:
      Add your target location, MTP devices appear automatically in the list if connected.
      Choose target location and encoder from the dropdown menus.
      Select a sync task from the list (not required for context command).
- On the 'Tasks' preference page:
      Choose a titleformatting string and select at least one playlist to sync (not required for context command).

Troubleshooting
If you believe you found a bug, please report it in this thread stating the version you used and the console output from foo_ows.
In case you encounter any crashes from this component, please also share the crash log and crash dump.
  • Last Edit: 14 July, 2017, 02:52:52 AM by zimjo

  • mudlord
  • [*][*][*][*][*]
  • Developer (Donating)
foo_onewaysync
Reply #1
Is it possible to support other encoders than LAME?
I've been wanting to write a component like this for some time for my Sansa Clip Zip for syncing files both ways between my player and reencoding files.

edit: spelling
  • Last Edit: 03 April, 2014, 04:05:48 AM by mudlord

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #2
Which encoder are you thinking of?
In principle, you can use any command line encoder able to handle PCM input, if it takes the two arguments source and destination filepath. The component does not care what is called, but it should produce a foobar compatible file at the expected location. However, some hardcoded command line options probably have to be adapted.

  • detmek
  • [*][*]
foo_onewaysync
Reply #3
Any chance to support DSP during conversion and lossy-lossy conversion?
I listen my music on phone which does not have crossfeed so I convert files using DSP Crossfeed into AAC. Source format is FLAC, AAC or MP3.

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #4
Good idea! I've added lossy-lossy conversion, since it is reasonable in case a portable player does not support certain file types.
DSP functionality, however, is beyond the scope of this component. Maybe you can find an app for your phone which has a crossfeed feature...

  • chamber32
  • [*]
foo_onewaysync
Reply #5
It would be great if one could specify max total size to copy.

c32

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #6
What is the benefit of this? You would not be able to prioritize which playlists or files get copied. So the behaviour is similar to right now, copying stops if space in the destination runs out. In particular, every time you run the onewaysync command the same files are copied. The proper way to do this is imho to limit the length of playlists. If you want more refined control over size of playlists I suggest to look into foo_random_pools.

foo_onewaysync
Reply #7
If there is no playlist checked in "sync commands and options" then foobar2000 crashes when calling a command from main menu -> file -> onewaysync.

I've sended the crash report by foobar2000s crash dialogue.

Edit:

In preferences under the components page foo_onewaysync appears 4 times in the listing

Edit2:

I've sended two crash reports mor. The component crshes often when applying commands from Context menu
  • Last Edit: 06 April, 2014, 10:44:51 AM by q-stankovic
german support forum: www.foobar-users.de / user: qwert73

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #8
Thanks for your feedback. Should all be fixed in newest version. Please let me know if you still experience crashes, in particular when using context command.

foo_onewaysync
Reply #9
Thank you for the component!

Before i come with some small suggestions and a feature request let me ask for the difference of the two commands in context menu "default" and "select..."

At first running the "default" command  opens the same pop up dialogue like "select..." and then not. I don't understand that? What means "default" exactly?. And wouldn't it be enough just to have a "sync to..." command in file operations submenu?

__________________________________________

Another point: isn't it possible to get by sdk the commands of the convert submenu? So it would be possible to grab that commands from the "process destination files with"-list and to take full advantage of fb2k's converter capabilities (edit: see mudlords and  detmeks requets)

__________________________________________

Edit: i would regard it as elegant if the context menu of one way sync would act like the other file operations commands: you start with "sync to..." and could use the dialogue for synching or saving a preset. Doing the latter would then turn "sync to..." command into  "sync to -> submenu (presets + ´...` for calling the sync dialogue)"

Edit2: Ok, that was a very spontaneous request with the recreation of context menu and leads to the idea (if making it work like copy and move to) to having the general sync options in the "playlist to device"-window.
  • Last Edit: 07 April, 2014, 02:17:57 PM by q-stankovic
german support forum: www.foobar-users.de / user: qwert73

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #10
I agree with you that it would be most elegant to use the built in foobar converter functionality. However, there is no interface to it in the SDK, in particular there is no way to get handles of the generated files.

The context menu commands should probably be made more intuitive. "Default" actually means last used setting. I will rename this and think about your suggestion for saving presets.

foo_onewaysync
Reply #11
Thank you for considering! I think apart from having commands in fileops submenu that are acting same the biggest advantage is to have the socalled "general sync options" defined seperately in each preset. So you can reflect that different devices act differently, f.e. one device can play a file format that the other one cannot. Global options are restricting in that case and only meaningful if having only one device. Edit: for the same reason i think it would be better to have these "general sync option" also preset specific in foobar2000 preferences so that the main menu actions could be adressed to different devices

________________________________________________

Two smaller suggestions for improving usability:

1. The name "Playlist to Device" for the popup windows is irritating: when running it the first time from context menu i thought that not only the selection would be copied but the whole playlist. Why not "Files to device"?

2. In preferences the "new" button at first adds the standard expression and then you have to click it for editing. Would be easier if the "new" button calls directly the editing window.



  • Last Edit: 08 April, 2014, 04:28:38 PM by q-stankovic
german support forum: www.foobar-users.de / user: qwert73

foo_onewaysync
Reply #12
I agree with you that it would be most elegant to use the built in foobar converter functionality. However, there is no interface to it in the SDK, in particular there is no way to get handles of the generated files.

I think you misunderstood me: i don't mean access of converter component directly by sdk but its commands in context menu - they are missing in the list of "process destination files with" list in ythe preferences. as far as i know that could be possible since i saw th access to dynamic submenus realized in several components. Wouldn't that do the trick?
  • Last Edit: 08 April, 2014, 06:05:42 PM by q-stankovic
german support forum: www.foobar-users.de / user: qwert73

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #13
No, as I stated above there is no way for my component to know where converter places the generated files. The key purpose of the component is to export playlist files, and store lossy conversions of lossless files, such that they don't need to be converted every single time. Both of which is not possible with what you suggest, at least not with the current SDK.

Thanks for your suggestions. I agree that the user interface is not perfectly polished, yet. Maybe I'll find time on the weekend to do that.

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #14
New version 0.2.6 available. Download here.
-improved: finding existing converted lossy files after move and rename
-improved: adding new folders and titleformat scripts is now more convenient

Currently, I do not plan to rework the context menu. I'm not really familiar with windows GUI programming and not eager to have to create more dialogs.    Just don't have the time for that now, also there doesn't seem to be a major interest...

  • yeeeargh
  • [*]
foo_onewaysync
Reply #15
hi,

just tested this component and I really like it. Exactly what I needed since I’m re-ripping my collection in FLAC.

But I foobar2000 crashes for me every time I use it. I tried running it via the menu command for a whole playlist and the context command for just a couple of files. The conversion works just fine and I have the files in the destination folder.

I sent both crash reports. If I can help you with other information to fix this, please let me know.

Anyways, thanks for the work!

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #16
Thanks for your kind feedback and reporting the issue. Are you using the latest version of the component?
Does the destination location contain the playlist files?

Could you please upload the crash logs here, or send them to me via PM. This is probably faster than retrieving them from Peter.

  • yeeeargh
  • [*]
foo_onewaysync
Reply #17
Thanks for your kind feedback and reporting the issue. Are you using the latest version of the component?

yes. 0.2.6

Does the destination location contain the playlist files?

it just generates the playlist file when I sync a playlist. when i just convert them via the file operations menu no playlist files get generated, am I right?
so yeah, the m3u8 playlist gets generated.

Could you please upload the crash logs here, or send them to me via PM. This is probably faster than retrieving them from Peter.

going to pm them to you.

  • fate
  • [*]
foo_onewaysync
Reply #18
seems copying fails when the source is part of an zip archive :/

Console:
Error while copying: Z:\irony [ClariS].zip|01 - irony.mp3 -> F:\Music\ClariS - irony


  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #19
A new version with minor fixes is available here. Please let me know if you still encounter unexpected behaviour or crashes.
Thanks for testing!

@fate: zip or rar files are not supported by this component, sorry. Typically, it does not save a lot of space to compress music files. Why not just uncompress them?

foo_onewaysync
Reply #20
Thank you very much for this component. I have been waiting for something like this for a long time (basically since my ipod broke and that I have to use other devices / services now).

The ipod manager was the (almost) perfect way to keep a device synced with only a little effort.

I am syncing Google Music a Blackberry Z1 and an old Nokia phone with mp4/mp3 capability now.

Looking at the features of One Way Sync I could use very much the following features:
  • Possibility to use multiple command line settings. Google music is best served with mp3 (everything else gets converted by google music). The other devices are better off with nero mp4 (better sound at very low bitrates).
  • Possibility to conduct multiple commands instead of only one
  • Using the converter e.g. downmixing 5.1. mixes to stereo, to resample to 44,1 kHz or applying replaygain. (Currently, conversion will fail if target e.g. mp3 does not support multiple channels).
  • Embed and resize album art. All devices do not show art if it exceeds a certain size. (like foo ipod did)
  • Even thorough you wrote that you have no know knowledge of where the files are written to: a foo-ipod-like sync functionality would be awesome. If new files are added only these get converted, if files are removed from the playlist, they are being removed from the device as well. (I remember the author stored a sql lite database on the device which stores information of all files on the device).
Again thanks for the development and wish you all the best.

Cheers.






  • xen126
  • [*]
foo_onewaysync
Reply #21
Been waiting for something like this for ages!

I can't seem to replace a string with an empty string though.

For example, $replace(%path%,A,B) is fine but not $replace(%path%,A,). Or am I doing something wrong?

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #22
Thank you very much for this component. I have been waiting for something like this for a long time (basically since my ipod broke and that I have to use other devices / services now).
...
Again thanks for the development and wish you all the best.

Cheers.

Thank you! 

Quote
  • Possibility to use multiple command line settings. Google music is best served with mp3 (everything else gets converted by google music). The other devices are better off with nero mp4 (better sound at very low bitrates).
  • Possibility to conduct multiple commands instead of only one

These are great ideas. I think I will implement them as soon as I have more time again...which will be in a few weeks.

Quote
  • Using the converter e.g. downmixing 5.1. mixes to stereo, to resample to 44,1 kHz or applying replaygain. (Currently, conversion will fail if target e.g. mp3 does not support multiple channels).

I see that multi channel audio is problematic. Though, using foobars converter is not possible for the reasons I listed above. Adding DSP functionality is in principal possible and would resolve the issues you mention. However, I do not see this happening anytime soon. You can apply replaygain also by processing the destination files with a command...

Quote
  • Embed and resize album art. All devices do not show art if it exceeds a certain size. (like foo ipod did)

Personally, I do not use embedded album art. I would expect that album art is present in destination files if it was present in source files, is this not the case? Unless resizing can be achieved with standard functions of the SDK or WinSDK I do not see this coming for future versions.

Quote
  • Even thorough you wrote that you have no know knowledge of where the files are written to: a foo-ipod-like sync functionality would be awesome. If new files are added only these get converted, if files are removed from the playlist, they are being removed from the device as well. (I remember the author stored a sql lite database on the device which stores information of all files on the device).

Currently, only new files get converted/copied if the option to store converted files at source location is activated. In a future version, I will change the behaviour such that it is not necessary to convert files that already exist at the target location even when that option is disabled.
Removing files from the device, when removed from a playlist, is something I would like to see implemented myself. However, it is not straightforward to do, as one file might be referenced in multiple playlists, e.g. even in a playlist which is not part of the onewaysync command being processed. Since I could not come up with a good and simple solution, this is postponed for a later release.


Quote
Been waiting for something like this for ages!

I can't seem to replace a string with an empty string though.

For example, $replace(%path%,A,B) is fine but not $replace(%path%,A,). Or am I doing something wrong?

Glad you like the component. Replacing with empty string works for me!

  • xen126
  • [*]
foo_onewaysync
Reply #23
Quote
Been waiting for something like this for ages!

I can't seem to replace a string with an empty string though.

For example, $replace(%path%,A,B) is fine but not $replace(%path%,A,). Or am I doing something wrong?

Glad you like the component. Replacing with empty string works for me!

I've been trying to replace multiple directories in the path so that I can preserve the folder structure when converting. $replace(%path%,C:\,) will work but anything more than that will result in an "incorrect path syntax", e.g. $replace(%path%,C:\Users,)

Although... I've been thinking that it might be easier to just keep the *.lossy.mp3 files and then extract them using a VBS later.

Also, it will be great if changed files, not just newly added files, will be converted as well! I suppose you can compare the .mp3's timestamp with the source file's "Date Modified" file attribute.

  • zimjo
  • [*][*][*]
  • Developer
foo_onewaysync
Reply #24
I've been trying to replace multiple directories in the path so that I can preserve the folder structure when converting. $replace(%path%,C:\,) will work but anything more than that will result in an "incorrect path syntax", e.g. $replace(%path%,C:\Users,)

Although... I've been thinking that it might be easier to just keep the *.lossy.mp3 files and then extract them using a VBS later.

Also, it will be great if changed files, not just newly added files, will be converted as well! I suppose you can compare the .mp3's timestamp with the source file's "Date Modified" file attribute.


Try $replace(%path%,C:\Users\,).
The component will sync changes in tags, that includes replaygain, automatically. So there is no need to compare timestamps... unless I misunderstood your intentions?