Menu

#657 showing filename when playback starts

Next_Release
closed-fixed
nobody
5
2017-12-25
2016-11-26
No

Hi,

I edited Core::changeOSD function to show filename when the playing starts:

void Core::changeOSD(int v) {
qDebug("Core::changeOSD: %d", v);

pref->osd = v;

proc->setPausingPrefix(pausing_prefix());
proc->setOSD(pref->osd);

if (v == 1) {
    QString curFileName = mdat.filename;
    QFileInfo fi(curFileName);
    if (pref->auto_add_to_playlist) {
        QStringList playlistFiles = Helper::filesForPlaylist(curFileName, pref->media_to_add_to_playlist);
        curFileName.replace("/", "\\");
        int i = 0, plFilesCnt = playlistFiles.size();
        for (; i < plFilesCnt; ++i)
            if (curFileName == playlistFiles[i])
                break;
        displayTextOnOSD(QString::number(i + 1) + "/" + QString::number(plFilesCnt) + " - " + fi.fileName());
    }
    else {
        displayTextOnOSD(fi.fileName());
    }
}

updateWidgets();

}

it even works when i change osd_delay to less than 2200ms (my setting is now 200ms).

what do you think?

Discussion

  • Dirk Fieldhouse

    Dirk Fieldhouse - 2016-12-29

    In 16.4 you can add the action show_filename in 'Options>Preferences>Advanced>Run the following actions every time a file is opened....' to achieve this.

     
    • Bishamon

      Bishamon - 2017-11-20

      I wasn't aware of this. Would you mind sharing with us what to put in there to display the file name every time a file is opened for about 2 seconds?

      Edit:
      Under the MPV tab, Options input, seems that using this would display the file name in OSD:

      --osd-msg1=${filename}

      However, it shows it all the time. Reading mpv's manual, --osd-playing-msg should display it when the file starts and then disappear. However, when I add the following, nothing shows up:

      --osd-playing-msg=${filename}

       

      Last edit: Bishamon 2017-11-20
  • Vojtech Jeso

    Vojtech Jeso - 2016-12-29

    I know about that, but in case you have multiple files in playlist it doesnt show total count and the count of the current file.

     
  • Dirk Fieldhouse

    Dirk Fieldhouse - 2017-07-11

    Moreover, show_filename has been replaced by a primitive that displays fuller information about the file, and needs to be restored.

     
  • Bilu

    Bilu - 2017-12-10

    Great! can you tell when this will be release please?? I was expecting this feature for a long time

     

    Last edit: Bilu 2017-12-10
  • Ricardo Villalba

    Version 17.12 adds a new action to display the filename in the OSD. You can add it to "Options>Preferences>Advanced>Run the following actions..."

    Passing --osd-playing-msg=${filename} to mpv works as well.

     
    • Bilu

      Bilu - 2017-12-31

      Thank you for the reply. I think it will be useful to set the showOSDText duration in smplayer.ini
      2 seconds is very not enough.
      Like this:

      void Core::showFilenameOnOSD() {
          qDebug("Core::showFilenameOnOSD");
          proc->showFilenameOnOSD(**pref->show_file_name_osd_delay**);
      }
      
      void MPVProcess::showFilenameOnOSD(int duration) {
      #ifdef OSD_WITH_TIMER
          osd_timer->stop();
      #endif
          showOSDText("${filename}", duration, 0);
      }
      

      Please consider this.

       
      • Ricardo Villalba

        Implemented in svn r8905.

         
  • Ricardo Villalba

    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB