Change AudioTrack by Language Priority

    • 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

      Quellcode

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


      automation of starting this script i have made by add bold ilenes into /etc/rc3.d/S90UserInit
      #!/bin/sh

      [ ! -e /usr/bin ] && mkdir /usr/bin
      [ ! -e /usr/keys ] && mkdir /usr/keys
      [ ! -e /usr/script ] && mkdir /usr/script

      [ ! -e /var/bin ] && ln -s /usr/bin /var/
      [ ! -e /var/keys ] && ln -s /usr/keys /var/
      [ ! -e /var/script ] && ln -s /usr/script /var/

      [ ! -e /usr/tmp ] && ln -s /tmp /usr/
      [ ! -e /var/tmp ] && ln -s /tmp /var/

      [ -e /usr/script/python_patcher.sh ] && /usr/script/python_patcher.sh
      [ -e /usr/script/skin_patcher.sh ] && /usr/script/skin_patcher.sh

      #echo "# Generated by $0">/var/etc/resolv.conf
      #echo "nameserver 86.63.180.2">>/var/etc/resolv.conf
      #echo "nameserver 195.2.96.2">>/var/etc/resolv.conf
      #echo "nameserver 10.0.10.251">>/var/etc/resolv.conf
      #echo "nameserver 10.0.10.253">>/var/etc/resolv.conf

      #route add SrvDSL gw 10.0.10.253
      #route add SrvDSL gw 10.0.10.251

      #/var/script/reboot_timer.sh 0500 &

      if [ -e /usr/script/Set_Audio_Language_by_Priority.sh ]; then
      /usr/script/Set_Audio_Language_by_Priority.sh &
      fi

      exit 0



      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 track when read them at begining
      in perfect case must be chosen Latst used track, but on first zap by Language priority
      Dateien
      dm7080sstt; 2x dm8000sstt; dm7020s <- Diseq1x4 <- 3x Diseq1x10 <-
      Dishes:
      1.8m 36E;28E;23E;19E;16E;13E;7E
      1.6m 42E;36E
      1.0m 10/9E;5E;1W;8W
      1.0m 15W;22W;30W
      1.1m 4/5W;12W;18W;24W
      1.1m 53E;60E
      1.0m 75E
      TVs: Philips 46pfl9707s; Philips 42pfl9703h
    • 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

      Quellcode

      1. def zap(self):
      2. self.revertMode=None
      3. ref = self.session.nav.getCurrentlyPlayingServiceReference()
      4. nref = self.getCurrentSelection()
      5. if ref is None or ref != nref:
      6. self.new_service_played = True
      7. self.session.nav.playService(nref)
      8. self.saveRoot()
      9. self.saveChannel(nref)
      10. config.servicelist.lastmode.save()
      11. self.addToHistory(nref)
      12. import os
      13. os.system("/usr/script/Set_Audio_Language_by_Priority.sh ExecuteOnce")
      Alles anzeigen

      or use my python_patcher.sh

      p.s.
      please leave your votes for implement AudioPriority into Enigma2(readPMT), this can be done only by DMM developers
      all other ways cant be perfect. Automated audio and subtitles selection
      Dateien
      dm7080sstt; 2x dm8000sstt; dm7020s <- Diseq1x4 <- 3x Diseq1x10 <-
      Dishes:
      1.8m 36E;28E;23E;19E;16E;13E;7E
      1.6m 42E;36E
      1.0m 10/9E;5E;1W;8W
      1.0m 15W;22W;30W
      1.1m 4/5W;12W;18W;24W
      1.1m 53E;60E
      1.0m 75E
      TVs: Philips 46pfl9707s; Philips 42pfl9703h
    • `grep` doesnt work when bash script is call from python

      Quellcode

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

      can someone developer suggest another method read data from files

      #!/bin/sh
      # MartiniB

      echo `date +%Y.%m.%d.\ %H:%M:%S`" $0 $1 $$">>/tmp/Set_Audio_Language_by_Priority.LOG

      [ "$1" = "ExecuteOnce" ] && ExecuteOnce=1

      E2Conf="/etc/enigma2/settings"
      [ ! -e $E2Conf ] && exit

      CfgLine=config.audio.LanguagePriority=

      LangPrioList=`grep $CfgLine $E2Conf| sed -e s/.*Priority=//| sed s/\ /_/g| sed s/\#/\ /g`
      echo -e `date +%Y.%m.%d.\ %H:%M:%S`" $crntNameExt -> LangPrioList: $LangPrioList">>/tmp/Set_Audio_Language_by_Priority.LOG

      dm7080sstt; 2x dm8000sstt; dm7020s <- Diseq1x4 <- 3x Diseq1x10 <-
      Dishes:
      1.8m 36E;28E;23E;19E;16E;13E;7E
      1.6m 42E;36E
      1.0m 10/9E;5E;1W;8W
      1.0m 15W;22W;30W
      1.1m 4/5W;12W;18W;24W
      1.1m 53E;60E
      1.0m 75E
      TVs: Philips 46pfl9707s; Philips 42pfl9703h
    • @boxfather
      that is about Enigma1(dm7000; dm500; dm7020; dm600)
      Enigma2 is too superior to have that simple feature

      still searching solution :(
      dm7080sstt; 2x dm8000sstt; dm7020s <- Diseq1x4 <- 3x Diseq1x10 <-
      Dishes:
      1.8m 36E;28E;23E;19E;16E;13E;7E
      1.6m 42E;36E
      1.0m 10/9E;5E;1W;8W
      1.0m 15W;22W;30W
      1.1m 4/5W;12W;18W;24W
      1.1m 53E;60E
      1.0m 75E
      TVs: Philips 46pfl9707s; Philips 42pfl9703h