-= Great radios for you developers and pupinians! =-

Moderator: Forum moderators

User avatar
Sofiya
Posts: 2279
Joined: Tue Dec 07, 2021 9:49 pm
Has thanked: 1477 times
Been thanked: 1524 times

Re: -= Great radios for you developers and pupinians! =-

Post by Sofiya »

keniv wrote: Mon Jan 09, 2023 12:55 pm

Thank for the reply. I'm sorry but I can't see any menu or any way to choose the above. I cannot find any button either in the screen display or by right clicking on the tray icon that allows me to do a search. Thanks for trying to help.

Regards,

Ken.

Edit: Just seen the playlist attachments. Thanks for these.

Then I'm sorry I can't help.
I have run out of words. only ....... left
maybe I have something special - YRadio-1.5_64

Attachments
Screenshot.gif
Screenshot.gif (282.75 KiB) Viewed 2450 times
Last edited by Sofiya on Mon Jan 09, 2023 4:06 pm, edited 1 time in total.

KL
PUPPY LINUX Simple fast free

keniv
Posts: 656
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 108 times
Been thanked: 67 times

Re: -= Great radios for you developers and pupinians! =-

Post by keniv »

@Sofiya and @fredx181
I now have it working. My error was that I used the same name for the .home directory as I used in v1.4. I should have used YRadio-1.5_64.home. I now have a .yradio directory the contents of which are shown in the image below. If I search on United Kingdom and then click "load" a long list of UK radio stations appear. Double clicking any one of these starts the station playing as expected. Thanks again for your patience.

Regards,

Ken

Attachments
cont-.yradio.png
cont-.yradio.png (16.32 KiB) Viewed 2429 times
User avatar
fredx181
Posts: 3071
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1309 times
Contact:

Re: -= Great radios for you developers and pupinians! =-

Post by fredx181 »

@Sofiya On your screenshots I see that the text at the top is partly hidden, I noticed this before on my tests with yad GTK3 (on KLV), but thought that I fixed.
What is exactly your setup / system where this happens ?

@keniv Good that it's working now for you, looks like in the first place you forgot to click 'Load' after typing search query.
(I sometimes make similar mistake by pressing ENTER after typing search query... nothing happens :? ;) need to click Load).

User avatar
Sofiya
Posts: 2279
Joined: Tue Dec 07, 2021 9:49 pm
Has thanked: 1477 times
Been thanked: 1524 times

Re: -= Great radios for you developers and pupinians! =-

Post by Sofiya »

fredx181 wrote: Mon Jan 09, 2023 5:20 pm

@Sofiya On your screenshots I see that the text at the top is partly hidden, I noticed this before on my tests with yad GTK3 (on KLV), but thought that I fixed.
What is exactly your setup / system where this happens ?

oops
This is KLV-Airedale download/file.php?id=13114
I'll take it with apimage 1.5 - I will replace the file - yradio
my hands grow like from where you need to.Thanks@fredx181 for pointing this out

What is exactly your setup / system where this happens ? --- I don't understand what you mean

Attachments
Screenshot.jpg
Screenshot.jpg (38.72 KiB) Viewed 2384 times

KL
PUPPY LINUX Simple fast free

User avatar
fredx181
Posts: 3071
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1309 times
Contact:

Re: -= Great radios for you developers and pupinians! =-

Post by fredx181 »

Sofiya wrote:

...
What is exactly your setup / system where this happens ? --- I don't understand what you mean

Well, I just wondered if it's GTK3 YAD you use (the appimage has gtk2 version included) and on which Puppy system.
But I probably understand now that you somehow did some mixing and fixed now, so, nevermind, I guess it's ok.

User avatar
Sofiya
Posts: 2279
Joined: Tue Dec 07, 2021 9:49 pm
Has thanked: 1477 times
Been thanked: 1524 times

Re: -= Great radios for you developers and pupinians! =-

Post by Sofiya »

fredx181 wrote: Mon Jan 09, 2023 7:56 pm

Well, I just wondered if it's GTK3 YAD you use (the appimage has gtk2 version included) and on which Puppy system.
But I probably understand now that you somehow did some mixing and fixed now, so, nevermind, I guess it's ok.

yad --version
12.0 (GTK+ 3.24.34)

KL
PUPPY LINUX Simple fast free

User avatar
fredx181
Posts: 3071
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1309 times
Contact:

YRadio update, v1.6

Post by fredx181 »

*** YRadio update, v1.6 ***

Focused on a more intuitive search for 'country', hopefully it is an improvement, I think it is, anyway, testing / feedback, I'd appreciate.

Change is that the 'search' box contains also a dropdown menu to search for a country (all these are supported for searching in the online database).
(it's a very big list, alphabetically ordered, so needs some .... scrolling to get to 'Z' e.g. Zimbabwe :roll: )

But still, just typing a country name is supported, but must start with upper-case letter, info from 'help' :

Search can contain multiple words, e.g: 'classic rock' and it's case insensitive
Or: rather than typing a search query, select a country from dropdown list
Still, typing a search query, will search for country name as well IF it matches,
but it's case sensitive, first letter needs to be upper-case e.g. Russian, United Kingdom, Netherlands, Hungary, New Zealand, Australia etc..
(or just partly, e.g. Nether , Austra, Russ will work too for country search)

So to be clear, just a few examples, say you type 'Cana' (or 'Canada' starting with upper-case) in the search box. it will search for country name 'Canada'
Not starting with upper-case, e.g. 'cana' it will search for 'name of station' e.g. will find radio stations with e.g, 'Canal' in the name.
Similar when typing 'Sing' (with upper-case first letter) it will find 'Singapore' country results BUT 'sing' will find stations with 'sing' and 'Sing' in the name.
Or when typing 'New' , then the search results will be from country 'New Zealand' , but when typing 'new' the results will be from stations name containing e.g. 'News' in the name.

Appimage 32-bit v1.6 (make executable and just click on it)
https://dl.dropboxusercontent.com/s/un0 ... .6_32?dl=1
Appimage 64-bit v1.6 (make executable and just click on it)
https://dl.dropboxusercontent.com/s/aiq ... .6_64?dl=1

2023-01-23_16-22-29.png
2023-01-23_16-22-29.png (160.32 KiB) Viewed 2304 times
keniv
Posts: 656
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 108 times
Been thanked: 67 times

Re: -= Great radios for you developers and pupinians! =-

Post by keniv »

@fredx181
Just installed v1.6. Have been playing with it for just a little while but I think it's a definite improvement. I like the drop down countries menu. I tried this with Germany and got the same long list as I got when typing it in on v1.5. I think the drop down menu makes it more user friendly. I also tried typing in "west" as I was looking to see if it would find West Sound which is a station local to me. It did find a long list of stations with "west" in their names but sadly not West Sound. I guess it's not in the data base. I do have a link for West Sound so not an issue anyway. I'll play with it some more.

Regards,

Ken.

step
Posts: 546
Joined: Thu Aug 13, 2020 9:55 am
Has thanked: 57 times
Been thanked: 198 times
Contact:

Re: -= Great radios for you developers and pupinians! =-

Post by step »

When I start it from a terminal I see

6:@disable@
6:@bash -c "load_list %3 %4"

Two things about @disable. 1) it should be "@disabled@". 2) regardless, it won't work to disable the button due to a yad design limitation.
But I wonder why those two lines are output instead of going to widget #6. Either there is no widget #6 in your yad dialog or a "@" is missing at the start of the command associated with the button that emits those lines.

User avatar
fredx181
Posts: 3071
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1309 times
Contact:

Re: -= Great radios for you developers and pupinians! =-

Post by fredx181 »

step wrote: Tue Jan 24, 2023 10:43 pm

When I start it from a terminal I see

6:@disable@
6:@bash -c "load_list %3 %4"

Two things about @disable. 1) it should be "@disabled@". 2) regardless, it won't work to disable the button due to a yad design limitation.
But I wonder why those two lines are output instead of going to widget #6. Either there is no widget #6 in your yad dialog or a "@" is missing at the start of the command associated with the button that emits those lines.

Thanks, as a test I removed these echo ... lines from the script and works still OK, so apparently unneeded.
I took the "frontend for find" wiki example https://sourceforge.net/p/yad-dialog/wi ... 0commands/ as a starting point for YRadio and thought 6:@disable@ was required for such a setup, but turns out not (indeed it doesn't do anything, not for the "find frontend" as well).

@keniv Thanks for the feedback !

step
Posts: 546
Joined: Thu Aug 13, 2020 9:55 am
Has thanked: 57 times
Been thanked: 198 times
Contact:

Re: -= Great radios for you developers and pupinians! =-

Post by step »

fredx181 wrote: Wed Jan 25, 2023 5:17 pm

Thanks, as a test I removed these echo ... lines from the script and works still OK, so apparently unneeded.
I took the "frontend for find" wiki example https://sourceforge.net/p/yad-dialog/wi ... 0commands/ as a starting point for YRadio and thought 6:@disable@ was required for such a setup, but turns out not (indeed it doesn't do anything, not for the "find frontend" as well).

Depending on how much you've taken from that script you may want to compare its latest version here https://github.com/v1cont/yad/wiki/Frontend-for-find(1). The yad wiki is maintained on github now.
Those two echo lines are supposed to disable and then re-enable the download button while downloading takes place, so a user can't start two downloads by mistake. However, as I mentioned in my previous post, yad can't properly disable/enable the button as intended due to design limitations.

User avatar
stemsee
Posts: 779
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 185 times
Been thanked: 131 times

Re: -= Great radios for you developers and pupinians! =-

Post by stemsee »

step wrote: Tue Jan 24, 2023 10:43 pm

When I start it from a terminal I see

6:@disable@
6:@bash -c "load_list %3 %4"

Two things about @disable. 1) it should be "@disabled@". 2) regardless, it won't work to disable the button due to a yad design limitation.
But I wonder why those two lines are output instead of going to widget #6. Either there is no widget #6 in your yad dialog or a "@" is missing at the start of the command associated with the button that emits those lines.

Yes it does work.....in transdialog function the button is disabled and greyed out until the translation completes, and then enabled again.

step
Posts: 546
Joined: Thu Aug 13, 2020 9:55 am
Has thanked: 57 times
Been thanked: 198 times
Contact:

Re: -= Great radios for you developers and pupinians! =-

Post by step »

What's transdialog? Do you mind posting the code? Is it yad or gtkdialog?

User avatar
stemsee
Posts: 779
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 185 times
Been thanked: 131 times

Re: -= Great radios for you developers and pupinians! =-

Post by stemsee »

Its a self contained set of functiondś

Code: Select all

function transdialoguefn { # google translate of text and websites, also dictionary lookup in available languages, and bilingual chat mode
[ -f  "$camino"/settings/theme ] && . "$camino"/settings/theme
[ "$ON_TOP" = "TRUE" ] && export ONTOP="--on-top"
export LANGUAGES='Afrikaans - af!Albanian - sq!Amharic - am!Arabic - ar!Armenian - hy!Azerbaijani - az!Basque - eu!Belarusian - be!Bengali - bn!Bosnian - bs!Bulgarian - bg!Cantonese - yue!Catalan - ca!Cebuano - ceb!Chichewa - ny!Chinese(Simple) - zh-CN!Chinese(Trad) - zh-TW!Corsican - co!Croatian - hr!Czech - cs!Danish - da!Dutch - nl!English - en!Esperanto - eo!Estonian - et!Fijian - fj!Filipino - tl!Finnish - fi!French - fr!Frisian - fy!Galician - gl!Georgian - ka!German - de!Greek - el!Gujarati - gu!Haitian-Creole - ht!Hausa - ha!Hawaiian - haw!Hebrew - he!Hindi - hi!Hmong - hmn!Hmong-Daw - mww!Hungarian - hu!Icelandic - is!Igbo - ig!Indonesian - id!Irish - ga!Italian - it!Japanese - ja!Javanese - jv!Kannada - kn!Kazakh - kk!Khmer - km!Klingon - tlh!Korean - ko!Kurdish - ku!Kyrgyz - ky!Lao - lo!Latin - la!Latvian - lv!Lithuanian - lt!Luxembourgish - lb!Macedonian - mk!Malagasy - mg!Malay - ms!Malayalam - ml!Maltese - mt!Maori - mi!Marathi - mr!Mongolian - mn!Myanmar - my!Nepali - ne!Norwegian - no!Pashto - ps!Persian - fa!Polish - pl!Portuguese - pt!Punjabi - pa!Queretaro-Otomi - otq!Roman - rm!Romanian - ro!Russian - ru!Samoan - sm!Scots-Gaelic - gd!Serbian(Cyr) - sr-Cyrl!Serbian(Latin) - sr-Latn!Sesotho - st!Shona - sn!Sindhi - sd!Sinhala - si!Slovak - sk!Slovenian - sl!Somali - so!Spanish - es!Sundanese - su!Swahili - sw!Swedish - sv!Tahitian - ty!Tajik - tg!Tamil - ta!Tatar - tt!Telugu - te!Thai - th!Tongan - to!Turkish - tr!Udmurt - udm!Ukrainian - uk!Urdu - ur!Uzbek - uz!Vietnamese - vi!Welsh - cy!Xhosa - xh!Yiddish - yi!Yoruba - yo!Yucatec-Maya - yua!Zulu - zu'
export saveAcmndA='@bash -c "AsaveA %2 %4"'
export saveBcmndB='@bash -c "BsaveB %2 %4"'
export run_acmd='@bash -c "run_dtrans1 %1 %2"'
export run_bcmd='@bash -c "run_dtrans2 %1 %2"'
export fpipe="$track/run_trans.$RANDOM"
mkfifo "$fpipe"
export dpipe="$track/run_trans.$RANDOM"
mkfifo "$dpipe"
trap "rm -f $fpipe $dpipe $track/run_trans1 $track/run_trans2" EXIT
fkey=$(($RANDOM * $$))
function AsaveA { # saves text in fields A1 and A2
5:@disabled@
if [[ ! -z "$1" ]]||[[ ! -z "$2" ]]; then
DATE=$(date +"%Y%m%d_%H%M%S")
echo -e "$1\n$2" > "$camino/notes/transAD-$DATE"
yad --title="Translation saved" --borders=6 --window-icon=$ICON --text="  <b>Saved to ~/.trans_tray/savedtexts/transD-$DATE </b>" --geometry=500x35-40-70 --undecorated --timeout 1 --no-buttons $ONTOP
printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" "" "" "" "" "`ls $camino/{books,profiles,scenes,notes}/* | tr '\n' '#'`" "$ACTIONCMND" "" "$SCALE" | sed 's/\\n|$//' > "$track"/pay
else
	exit
fi
5:@enable@
};export -f AsaveA
function BsaveB { # saves text in fields B1 and B2
5:@disabled@
if [[ ! -z "$1" ]]||[[ ! -z "$2" ]]; then
DATE=$(date +"%Y%m%d_%H%M%S")
echo -e "$1\n$2" > "$camino/notes/transBD-$DATE"
yad --title="Translation saved" --borders=6 --window-icon=$ICON --text="  <b>Saved to ~/.trans_tray/savedtexts/transD-$DATE </b>" --geometry=500x35-40-70 --undecorated --timeout 1 --no-buttons $ONTOP
printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" "" "" "" "" "`ls $camino/{books,profiles,scenes,notes}/* | tr '\n' '#'`" "$ACTIONCMND" "" "$SCALE" | sed 's/\\n|$//' > "$track"/pay
else
	exit
fi
5:@enable@
};export -f BsaveB
function run_dtrans1 { # sends A1 text for google translation
3:@disabled@

export TLANG1="$1"; export _TLANG1=$(echo "$1" | awk '{print $1}')
echo $TLANG1 > "$camino"/settings/.trans_target_lang3
[ -z "$TLANG1" ] && export TLANG1="English - en"
[ -z "$_TLANG1" ] && export _TLANG1="English"
export ENGINE=$(cat "$camino"/settings/_trans_engine_2 2> /dev/null)
[ -z "$ENGINE" ] && ENGINE=google
[ -n "$2" ] && export TTEXT="$2" || exit
if [[ $(echo -e "$TTEXT" | cut -c1) != '#' ]]; then
	T_TEXT=$(for ex in $ENGINE
	do
	echo -e "$TTEXT" | trans -e $ex -b -tl $(echo $TLANG1 | awk '{print $NF}'); done)
else
	TTEXT=$(echo $TTEXT | cut -c2-$$)
	T_TEXT=$(for ex in $TTEXT
	do
	trans -show-languages=y -show-original-phonetics=y -show-original-dictionary=y "$ex" -e "google" -tl "$(echo $TLANG1 | awk '{print $NF}')" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"; done)
fi
echo -e "$T_TEXT" > "$track"/run_trans1
T_TEXT=$(while read -r line; do printf "%s" "$line\n"; done <<< "$T_TEXT")
printf "%s\n%s\n%s\n%s\n%s\n" "" "" "" "$T_TEXT" "" | sed s'/\\n$//' >> $fpipe
3:@enable@
}; export -f run_dtrans1

function run_dtrans2 { # sends B1 text for google translation
3:@disabled@
export TLANG2="$1"
export _TLANG2=$(echo "$1" | awk '{print $1}')
echo $TLANG2 > "$camino"/settings/.trans_target_lang4
[ -z "$TLANG2" ] && export TLANG2="English - en"
[ -z "$_TLANG2" ] && export _TLANG2="English"
export ENGINE=$(cat "$camino"/settings/_trans_engine_2 2> /dev/null)
[ -z "$ENGINE" ] && ENGINE=google
[ -n "$2" ] && export TTEXT="$2" || exit
if [[ $(echo -e "$TTEXT" | cut -c1) != '#' ]]; then
	T_TEXT=$(for ex in $ENGINE
	do
	echo -e "$TTEXT" | trans -e $ex -b -tl $(echo $TLANG2 | awk '{print $NF}'); done)
else
	TTEXT=$(echo $TTEXT | cut -c2-$$)
	T_TEXT=$(for ex in $TTEXT
	do
	trans -show-original-phonetics=y "$ex" -e "google" -tl "$(echo $TLANG2 | awk '{print $3}')" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"; done)
fi
echo -e "$T_TEXT" > "$track"/run_trans2
T_TEXT=$(while read -r line; do printf "%s" "$line\n"; done <<< "$T_TEXT")
printf "%s\n%s\n%s\n%s\n%s\n" "" "" "" "$T_TEXT" "" | sed s'/\\n$//' >> $dpipe
}; export -f run_dtrans2

function execmndfn { # executes slected command string
	A_TEXT=$(eval "$($CLIP)" | while read -r line; do  printf "%s" "$line\n" | sed 's/\\n|$//'; done)
	printf "%s\n%s\n%s\n%s\n%s\n" '' '' '' "$A_TEXT" '' > "$dpipe"
3:@enable@
}; export -f execmndfn

function espeakfn { # speaks selected text and prints pphonetics in B2 field
	[[ ! -z $(ps -e | grep espeak) ]] && killall espeak
	[ ! -z $(busybox which espeak) ] && espeak -a 50 -s 160 -p 50 -v "$(cat $camino/.trans_target_lang3 | awk '{print $3}')" "$($CLIP)" &
	[ ! -z $(busybox which espeak) ] && espeak -q -s 160 -p 50 -v "$(cat $camino/.trans_target_lang3 | awk '{print $3}')" "$($CLIP)" --ipa  --phonout="$track"/espeak &
	[ -f "$track"/espeak ] && T_TEXT=$(cat "$track"/espeak)
	A_TEXT=$(while read -r line; do printf "%s" "$line\n"; done <<< "$T_TEXT")
	printf "%s\n%s\n%s\n%s\n%s\n" '' '' '' "$A_TEXT" '' > "$dpipe"
}; export -f espeakfn

function clearfn { # clears respective fields of text contents
	case "$1" in
A1) printf "%s\n%s\n%s\n%s\n%s\n" '' '\' '' '' '' >> "$fpipe";; 
A2) printf "%s\n%s\n%s\n%s\n%s\n" '' '' '' '\' '' >> "$fpipe";;
B1) printf "%s\n%s\n%s\n%s\n%s\n" '' '\' '' '' '' >> "$dpipe";;
B2) printf "%s\n%s\n%s\n%s\n%s\n" '' '' '' '\' '' >> "$dpipe";;
ALL) printf "%s\n%s\n%s\n%s\n%s\n" '' '\' '' '\' '' > "$fpipe"
printf "%s\n%s\n%s\n%s\n%s\n" '' '\' '' '\' '' > "$dpipe";; 
	  esac
}; export -f clearfn

[[ ! -z $(which espeak) ]] && ESPEAK='--button="eSpeak!$iconpath/speaker.png!eSpeak language is set after A group translation\nselect text and click this button:bash -c espeakfn"''' || ESPEAK=""
#export ESPEAK
export TLANG1=$(cat "$camino"/settings/.trans_target_lang3 2> /dev/null)
export _TLANG1=$(cat "$camino"/settings/.trans_target_lang3 2> /dev/null | awk '{print $1}')
[ -z "$TLANG1" ] && export TLANG1="English - en"
[ -z "$_TLANG1" ] && export _TLANG1="English"
export TLANG2=$(cat "$camino"/settings/.trans_target_lang4 2> /dev/null)
export _TLANG2=$(cat "$camino"/settings/.trans_target_lang4 2> /dev/null | awk '{print $1}')
[ -z "$TLANG2" ] && export TLANG2="English - en"
[ -z "$_TLANG2" ] && export _TLANG2="English"
exec 5<> ${fpipe}
exec 6<> ${dpipe}
echo -e '\f' >&5
printf "%s\n%s\n%s\n%s\n%s\n" "$TLANG1!$LANGUAGES"  "" "$run_acmd" "$A_TEXT" "${saveAcmndA}" > "$fpipe"
printf "%s\n%s\n%s\n%s\n%s\n" "$TLANG2!$LANGUAGES"  "" "$run_bcmd" "$A_TEXT" "${saveBcmndB}" > "$dpipe"
case "$THEME" in
*dark*) GTK2_RC_FILES="$track/gtkrc_snapp" yad --plug="$fkey" --tabnum=1 --listen --fontname="$FONT" --form --cycle-read --field="TL:CB" --field="<b>A1:</b>  Input/paste:TXT" --field="Translate!gtk-refresh!Start with # for dictionary lookup:fbtn" --field="<b>A2:</b>    Translation:TXT" --field="Save!gtk-save!Saves A1A2 text:fbtn" <&5 &
GTK2_RC_FILES="$track/gtkrc_snapp" yad --plug="$fkey" --tabnum=2 --listen --fontname="$FONT" --form --cycle-read --field="TL:CB" --field="<b>B1:</b>  Input/paste:TXT" --field="Translate!gtk-refresh!eSpeak language is set after A group translation :fbtn"  --field="<b>B2:</b>    Translation / Phonetics:TXT"  --field="Save!gtk-save!Saves B1B2 text":fbtn <&6 &
GTK2_RC_FILES="$track/gtkrc_snapp" yad --key=$fkey --title="Dialogue mode" --splitter=400 --window-icon="$camino/icons/transtray.png" --image-on-top --image="$camino/icons/banner.png" --width=700 --height=600 --paned --tab=AB --tab=BA --orient=hori --buttons-layout=center --button="Clear A1:bash -c 'clearfn A1'" --button="Clear A2:bash -c 'clearfn A2'" --button="Clear B1:bash -c 'clearfn B1'" --button="Clear B2:bash -c 'clearfn B2'" --button="Exec!$iconpath/xterm.xpm!select code string with cursor then click this button:bash -c execmndfn" --button="eSpeak!$iconpath/speaker.png!eSpeak language is set after A group translation\nselect text and click this button:bash -c espeakfn" $ONTOP
;;
*light*) yad --plug="$fkey" --tabnum=1 --listen --fontname="$FONT" --form --cycle-read --field="TL:CB" --field="<b>A1:</b>  Input/paste:TXT" --field="Translate!gtk-refresh!Start with # for dictionary lookup:fbtn" --field="<b>A2:</b>    Translation:TXT" --field="Save!gtk-save!Saves A1A2 text":fbtn <&5 &
yad --plug="$fkey" --tabnum=2 --listen --fontname="$FONT" --form --cycle-read --field="TL:CB" --field="<b>B1:</b>  Input/paste:TXT" --field="Translate!gtk-refresh!Translate B1 text into B Language and show in B2 :fbtn"  --field="<b>B2:</b>    Translation / Phonetics:TXT" --field="Save!gtk-save!Saves B1B2 text":fbtn <&6 &
yad --key=$fkey --title="Dialogue mode" --splitter=400 --window-icon="$camino/icons/transtray.png" --image-on-top --image="$camino/icons/banner.png" --width=700 --height=600 --paned --tab=AB --tab=BA --orient=hori --buttons-layout=center --button="Clear A1:bash -c 'clearfn A1'" --button="Clear A2:bash -c 'clearfn A2'" --button="Clear B1:bash -c 'clearfn B1'" --button="Clear B2:bash -c 'clearfn B2'" --button="Exec!$iconpath/xterm.xpm!select code string with cursor then click this button:bash -c execmndfn" --button="eSpeak!$iconpath/speaker.png!eSpeak language is set after A group translation\nselect text and click this button:bash -c espeakfn" $ONTOP
;;
esac
}; export -f transdialoguefn
step
Posts: 546
Joined: Thu Aug 13, 2020 9:55 am
Has thanked: 57 times
Been thanked: 198 times
Contact:

Re: -= Great radios for you developers and pupinians! =-

Post by step »

And how can I run the self-contained set of functions? There is no "main" to pull them all together.
Regardless, those functions use "@disabled@" with a final "d@". My earlier comment said that "@disable@" (without d) doesn't work, and that it should be replaced with "@disabled@". We are in agreement.
My comment also said that even "@disabled@" wouldn't work for Fred's code. My comment was about Fred's code, not this set of translation functions. If separate commands are used to send "@disabled@" and then some other value to re-enable the button, then yes, @disabled@ works. My point is that disabling and then enabling the same button with a SINGLE command doesn't work because, in this case, yad does not process command output as it's being produced, but only after it was produced. Therefore the field receives @disabled@ and then IMMEDIATELY after (microseconds apart) "some other value" that re-enables the field. To sum up, to disable/enable a form button you need to keep the command that sends @disabled@ and the command that sends "some other value as separate processes.

User avatar
fredx181
Posts: 3071
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 374 times
Been thanked: 1309 times
Contact:

Re: -= Great radios for you developers and pupinians! =-

Post by fredx181 »

step wrote:

Depending on how much you've taken from that script you may want to compare its latest version here https://github.com/v1cont/yad/wiki/Frontend-for-find(1). The yad wiki is maintained on github now.

I tried that one and can confirm that when clicking the yad-search button more than once (while busy searching) it starts searching again after finished, so button is NOT disabled while busy, I'd say (although it 'looks' busy, not really greyed out though, note that difference).
My yradio script became much different btw, it's using --cycle-read and outputs to a pipe in the first pane --form command.
It has the same "problem" (clicking Load more than once while busy, it starts again searching after finished), but I found by experimenting that in yradio script commenting out line 585 to # echo "6:$load_cmd" (edit: and same on line 522) (load_cmd = @bash -c "load_list %3 %4", command to load the list) makes it work to NOT load again when clicking the 'Load' button more than once while busy (edit: to be clear, didn't change anything else, kept 6:@disable@ , instead of 6:@disabled@, but probably doesn't matter in this case).
Don't ask me why it works, for me it's a bit overwhelming :shock: to really understand this stuff.
EDIT: Strikethrough above text as on more testing it didn't work out well.
EDIT: Tried to modify the "frontend for find" script (as being a good test case perhaps), to make it work not searching again, clicking the button while busy, but couldn't, perhaps it needs a different setup with --form --cycle-read, not sure.

EDIT: More about this here: https://forum.puppylinux.com/viewtopic. ... 818#p79818

User avatar
AntonioPt
Posts: 219
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 99 times
Been thanked: 37 times

Re: -= Great radios for you developers and pupinians! =-

Post by AntonioPt »

hello all is there a script to convert m3u to a playlist that simpleGtkRadio use since i found direct link of full list of radios working and i wanna void doing manualy https://github.com/junguler/m3u-radio-m ... s/main.zip

Best regards

Why astronauts use Linux
Because you can't open windows in space

User avatar
Jasper
Posts: 2067
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 854 times
Been thanked: 480 times

Re: -= Great radios for you developers and pupinians! =-

Post by Jasper »

Updated radio list for BBC radio stations:

Code: Select all


# These provide better compatibility with some devices/software.
# The above streams are worldwide so sports commentary, etc may not be available. 
# For UK restricted content, replace 96000 with 128000 or 320000.
# Different bitrates are available by replacing 96000 :
# 48000 = 48k, 96000 = 96k
# UK only: 128000 = 128k, 320000 = 320k

#EXTINF:-1,BBC - Radio 1Xtra
http://lstn.lv/bbc.m3u8?station=bbc_1xtra&bitrate=96000
#EXTINF:-1,BBC - Radio 1Dance
http://lstn.lv/bbc.m3u8?station=bbc_radio_one_dance&bitrate=96000
#EXTINF:-1,BBC - Radio 1Relax
http://lstn.lv/bbc.m3u8?station=bbc_radio_one_relax&bitrate=96000
#EXTINF:-1,BBC - Radio 2
http://lstn.lv/bbc.m3u8?station=bbc_radio_two&bitrate=96000
#EXTINF:-1,BBC - Radio 3
http://lstn.lv/bbc.m3u8?station=bbc_radio_three&bitrate=96000
#EXTINF:-1,BBC - Radio 4
http://lstn.lv/bbc.m3u8?station=bbc_radio_fourfm&bitrate=96000
#EXTINF:-1,BBC - Radio 4 LW
http://lstn.lv/bbc.m3u8?station=bbc_radio_fourlw&bitrate=96000
#EXTINF:-1,BBC - Radio 4 Extra
http://lstn.lv/bbc.m3u8?station=bbc_radio_four_extra&bitrate=96000
#EXTINF:-1,BBC - Radio 5 live
http://lstn.lv/bbc.m3u8?station=bbc_radio_five_live&bitrate=96000
#EXTINF:-1,BBC - Radio 6 Music
http://lstn.lv/bbc.m3u8?station=bbc_6music&bitrate=96000
#EXTINF:-1,BBC - Radio 5 Live sports extra (UK Only)
http://lstn.lv/bbc.m3u8?station=bbc_radio_five_live_sports_extra&bitrate=96000
#EXTINF:-1,BBC - Radio Asian Network
http://lstn.lv/bbc.m3u8?station=bbc_asian_network&bitrate=96000
#EXTINF:-1,BBC - BBC World Service
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/sbr_low/ak/bbc_world_service.m3u8
#EXTINF:-1,BBC - BBC CWR
http://lstn.lv/bbc.m3u8?station=bbc_radio_coventry_warwickshire&bitrate=96000
#EXTINF:-1,BBC - BBC Essex
http://lstn.lv/bbc.m3u8?station=bbc_radio_essex&bitrate=96000
#EXTINF:-1,BBC - BBC Hereford Worcester
http://lstn.lv/bbc.m3u8?station=bbc_radio_hereford_worcester&bitrate=96000
#EXTINF:-1,BBC - Radio Berkshire
http://lstn.lv/bbc.m3u8?station=bbc_radio_berkshire&bitrate=96000
#EXTINF:-1,BBC - Radio Bristol
http://lstn.lv/bbc.m3u8?station=bbc_radio_bristol&bitrate=96000
#EXTINF:-1,BBC - Radio Cambridge
http://lstn.lv/bbc.m3u8?station=bbc_radio_cambridge&bitrate=96000
#EXTINF:-1,BBC - Radio Cornwall
http://lstn.lv/bbc.m3u8?station=bbc_radio_cornwall&bitrate=96000
#EXTINF:-1,BBC - Radio Cumbria
http://lstn.lv/bbc.m3u8?station=bbc_radio_cumbria&bitrate=96000
#EXTINF:-1,BBC - Radio Cymru
http://lstn.lv/bbc.m3u8?station=bbc_radio_cymru&bitrate=96000
#EXTINF:-1,BBC - Radio Cymru 2
http://lstn.lv/bbc.m3u8?station=bbc_radio_cymru_2&bitrate=96000
#EXTINF:-1,BBC - Radio Derby
http://lstn.lv/bbc.m3u8?station=bbc_radio_derby&bitrate=96000
#EXTINF:-1,BBC - Radio Devon
http://lstn.lv/bbc.m3u8?station=bbc_radio_devon&bitrate=96000
#EXTINF:-1,BBC - Radio Foyle
http://lstn.lv/bbc.m3u8?station=bbc_radio_foyle&bitrate=96000
#EXTINF:-1,BBC - Radio Gloucestershire
http://lstn.lv/bbc.m3u8?station=bbc_radio_gloucestershire&bitrate=96000
#EXTINF:-1,BBC - Radio Guernsey
http://lstn.lv/bbc.m3u8?station=bbc_radio_guernsey&bitrate=96000
#EXTINF:-1,BBC - Radio Humberside
http://lstn.lv/bbc.m3u8?station=bbc_radio_humberside&bitrate=96000
#EXTINF:-1,BBC - Radio Jersey
http://lstn.lv/bbc.m3u8?station=bbc_radio_jersey&bitrate=96000
#EXTINF:-1,BBC - Radio Kent
http://lstn.lv/bbc.m3u8?station=bbc_radio_kent&bitrate=96000
#EXTINF:-1,BBC - Radio Lancashire
http://lstn.lv/bbc.m3u8?station=bbc_radio_lancashire&bitrate=96000
#EXTINF:-1,BBC - Radio Leeds
http://lstn.lv/bbc.m3u8?station=bbc_radio_leeds&bitrate=96000
#EXTINF:-1,BBC - Radio Leicester
http://lstn.lv/bbc.m3u8?station=bbc_radio_leicester&bitrate=96000
#EXTINF:-1,BBC - Radio Lincolnshire
http://lstn.lv/bbc.m3u8?station=bbc_radio_lincolnshire&bitrate=96000
#EXTINF:-1,BBC - Radio London
http://lstn.lv/bbc.m3u8?station=bbc_london&bitrate=96000
#EXTINF:-1,BBC - Radio Manchester
http://lstn.lv/bbc.m3u8?station=bbc_radio_manchester&bitrate=96000
#EXTINF:-1,BBC - Radio Merseyside
http://lstn.lv/bbc.m3u8?station=bbc_radio_merseyside&bitrate=96000
#EXTINF:-1,BBC - Radio nan Gaidheal
http://lstn.lv/bbc.m3u8?station=bbc_radio_nan_gaidheal&bitrate=96000
#EXTINF:-1,BBC - Radio Newcastle
http://lstn.lv/bbc.m3u8?station=bbc_radio_newcastle&bitrate=96000
#EXTINF:-1,BBC - Radio Norfolk
http://lstn.lv/bbc.m3u8?station=bbc_radio_norfolk&bitrate=96000
#EXTINF:-1,BBC - Radio Northampton
http://lstn.lv/bbc.m3u8?station=bbc_radio_northampton&bitrate=96000
#EXTINF:-1,BBC - Radio Nottingham
http://lstn.lv/bbc.m3u8?station=bbc_radio_nottingham&bitrate=96000
#EXTINF:-1,BBC - Radio Orkney
http://lstn.lv/bbc.m3u8?station=bbc_radio_orkney&bitrate=96000
#EXTINF:-1,BBC - Radio Oxford
http://lstn.lv/bbc.m3u8?station=bbc_radio_oxford&bitrate=96000
#EXTINF:-1,BBC - Radio Scotland FM
http://lstn.lv/bbc.m3u8?station=bbc_radio_scotland_fm&bitrate=96000
#EXTINF:-1,BBC - Radio Scotland MW
http://lstn.lv/bbc.m3u8?station=bbc_radio_scotland_mw&bitrate=96000
#EXTINF:-1,BBC - Radio Sheffield
http://lstn.lv/bbc.m3u8?station=bbc_radio_sheffield&bitrate=96000
#EXTINF:-1,BBC - Radio Shropshire
http://lstn.lv/bbc.m3u8?station=bbc_radio_shropshire&bitrate=96000
#EXTINF:-1,BBC - Radio Solent
http://lstn.lv/bbc.m3u8?station=bbc_radio_solent&bitrate=96000
#EXTINF:-1,BBC - Radio Solent West Dorset
http://lstn.lv/bbc.m3u8?station=bbc_radio_solent_west_dorset&bitrate=96000
#EXTINF:-1,BBC - Radio Somerset Sound
http://lstn.lv/bbc.m3u8?station=bbc_radio_somerset_sound&bitrate=96000
#EXTINF:-1,BBC - Radio Stoke
http://lstn.lv/bbc.m3u8?station=bbc_radio_stoke&bitrate=96000
#EXTINF:-1,BBC - Radio Suffolk
http://lstn.lv/bbc.m3u8?station=bbc_radio_suffolk&bitrate=96000
#EXTINF:-1,BBC - Radio Surrey
http://lstn.lv/bbc.m3u8?station=bbc_radio_surrey&bitrate=96000
#EXTINF:-1,BBC - Radio Sussex
http://lstn.lv/bbc.m3u8?station=bbc_radio_sussex&bitrate=96000
#EXTINF:-1,BBC - Radio Tees
http://lstn.lv/bbc.m3u8?station=bbc_tees&bitrate=96000
#EXTINF:-1,BBC - Radio Ulster
http://lstn.lv/bbc.m3u8?station=bbc_radio_ulster&bitrate=96000
#EXTINF:-1,BBC - Radio Wales
http://lstn.lv/bbc.m3u8?station=bbc_radio_wales_fm&bitrate=96000
#EXTINF:-1,BBC - Radio Wiltshire
http://lstn.lv/bbc.m3u8?station=bbc_radio_wiltshire&bitrate=96000
#EXTINF:-1,BBC - Radio WM
http://lstn.lv/bbc.m3u8?station=bbc_wm&bitrate=96000
#EXTINF:-1,BBC - Radio York
http://lstn.lv/bbc.m3u8?station=bbc_radio_york&bitrate=96000
#EXTINF:-1,BBC - Three Counties Radio
http://lstn.lv/bbc.m3u8?station=bbc_three_counties_radio&bitrate=96000

Post Reply

Return to “Multimedia”