Menu

export: header fields do not export totals

jerry
2017-08-10
2017-08-10
  • jerry

    jerry - 2017-08-10

    On the Export dialog, adding %d / %D / %{duration} / %{seconds} to the Header field shows the time for the first track, and in the Footer they show the time for the last track.

    Is it possible to have fields for the total number of seconds for all tracks?

    Also, is it possible/difficult to add a tag for the number of bytes (per track and for all tracks together)?

    Thanks!
    Jerry

     
  • jerry

    jerry - 2017-08-10

    If it's not possible I guess I should do this with QML then?

     
  • jerry

    jerry - 2017-08-10

    Sorry, this should have gone in the Help forum... Can someone move this?

     
  • Urs Fleisch

    Urs Fleisch - 2017-08-10

    It did not find an option to move it. I will have a look at the problem later.

     
  • Urs Fleisch

    Urs Fleisch - 2017-08-10

    Such functions are not provided out of the box. But they are a good example for some homework about what can be done with QML scripts and the helper functions of Kid3. To get the duration in seconds, you could import it into a frame and then get the frame's value and finally restore the original value of the frame:

    oldComment = app.getFrame(2, 'comment')
    app.importFromTags(2, '%{seconds}', '%{comment}(.+)')
    seconds = app.getFrame(2, 'comment')
    app.setFrame(2, 'comment', oldComment)
    

    To get the bytes of a file is not very efficient but nevertheless possible:

    script.getDataSize(script.readFile(app.selectionInfo.filePath))
    

    Now you have to loop through all files as is done in the example scripts and perform these operations.