Change AudioTrack by Language Priority

  • have asked for this simple feature, but during log years it wasnt came -
    in case Pyton is too dark for me i wrote in style 'as i can'


    priority parameters saved in /etc/enigma2/settings, line config.audio.LanguagePriority=
    add them when enigma isnt active, commands for telnet console

    Code
    init 4
    echo "config.audio.LanguagePriority=Latvian#Russian#rus#English#englisch#engl#orj#dos#ORY#orig#org#Tonoption 2#">>/etc/enigma2/settings
    init 3


    automation of starting this script i have made by add bold lines into /etc/rc3.d/S90UserInit



    p.s.
    script works, but makes dreambox little freezy, next step is translate it to Python and add somewhere around def zap() in the ChannelSelection.py
    or the best place will be change order of tracks when read them at begining
    in perfect case must be chosen Latst used track, but on first zap by Language priority

  • tryed different way of starting, instead run script all time long and wait for service change(this made box little freezy)
    now i start script just once with new parameter `ExecuteOnce` only on chanel change


    to start new way you have to add two lines into /usr/lib/enigma2/python/Screens>ChannelSelection.py and restart gui


    or use my python_patcher.sh


    p.s.
    please leave your votes for implement AudioPriority into Enigma2(readPMT), this can be done only by developers
    all other ways cant be perfect. Automated audio and subtitles selection

  • Check this thread for both automatic audio and subtitles with proper linebreaks etc....
    Teletext subtitles

    Dreambox 8000CC, Epson TW3200 with Euroscreen Black Grey 86", Pioneer VSX-1017, AMD A8-3850, OpenSUSE 12.1, EeePC 900, Xbox, Playstation 3

  • UP!


    dear Enigma2 developers, why implemet few lines in Enigma2 code is that imposible?


    this feature must be as simple for users as simple for developers(make once and forget about it)


    from user side:
    AudioSelection menu have new button[Menu] where comes that suboptions
    1. add current selected tracktitle to priority list
    2. change order in priority list(ok=select; up=move up; down=move down; red=remove from list)


    from developers side:
    1. values stored in /etc/enigma2/settings
    parameter: config.audio.LanguagePriority=Latvian#Russian#rus#English#englisch#engl#orj#dos#ORY#orig#org#Tonoption 2#
    without count limit
    2. used on first zap(when not stored last used track in /etc/enigma2/lamedb)
    at the read PMT, and change order of audiotracks in AudioMenu


    examle:
    if PMT shows there are that tracks

    Code
    mpeg2;	101;	lang1
    mpeg2;	102;	lang2
    mpeg2;	103;	lang3
    mpeg2;	104;	lang4
    ac3;	201;	lang1
    ac3;	202;	lang2
    ac3;	203;	lang3
    ac3;	204;	lang4


    and prio list is is =lang3#lang2#lang9 then tracks in AudioMenu must be reordered like

    Code
    mpeg2;	103;	lang3
    ac3;	203;	lang3
    mpeg2;	102;	lang2
    ac3;	202;	lang2
    mpeg2;	101;	lang1
    mpeg2;	104;	lang4
    ac3;	201;	lang1
    ac3;	204;	lang4


    but when Ac3 is ON then ac3-s come first

    Code
    ac3;	203;	lang3
    mpeg2;	103;	lang3
    ac3;	202;	lang2
    mpeg2;	102;	lang2
    ac3;	201;	lang1
    ac3;	204;	lang4
    mpeg2;	101;	lang1
    mpeg2;	104;	lang4
  • `grep` doesnt work when bash script is call from python

    Code
    import os
    			os.system("/usr/script/Set_Audio_Language_by_Priority.sh ExecuteOnce &")


    can someone developer suggest another method read data from files


  • Seems to me as if you expect the executables to be within the path of
    the shell environment you start via python.
    Are you sure that the shell environment does load the profile? If not,
    load the profile in your script first and retry.
    E.g.

    Bash
    #!/bin/sh
    . /etc/profile

    DM900 SS, DM8000SSSS
    Kein Support per PN! Nutzt das Forum zum Fragen, dann haben auch andere etwas davon.

  • thanks for answer, but didnt help :frowning_face:
    tryed
    . /etc/profile
    and
    ./etc/profile
    btw script were working with OE1.5 images


    red commands make just empty line

  • The space behind the "." (dot) is important. It causes the shell to "source" the file
    instead of starting a new session. "Source" means to execute in the current session,
    which enables one to set environment variables in a separate script.
    You checked that /etc/profile contains the correct path to your executables?

    DM900 SS, DM8000SSSS
    Kein Support per PN! Nutzt das Forum zum Fragen, dann haben auch andere etwas davon.

  • didn catch a moment when started work again, with current experimental works