Skip to content

Commit

Permalink
changed chimes in xml to stream for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
talkkonnect committed Mar 17, 2021
1 parent 1a741cc commit 9e921c6
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 91 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ For a speaker muting to work when pressing a PTT, you need to enter the exact na
│ <F5> Digital Volume Up (+) │ <F6> Digital Volume Down (-) │
│ <F7> List Server Channels │ <F8> Start Transmitting │
│ <F9> Stop Transmitting │ <F10> List Online Users │
│ <F11> Playback/Stop Chimes │ <F12> For GPS Position │
│ <F11> Playback/Stop Stream │ <F12> For GPS Position │
├─────────────────────────────┼────────────────────────────────┤
│<Ctrl-D> Debug Stacktrace │ │
├─────────────────────────────┼────────────────────────────────┤
Expand Down Expand Up @@ -489,7 +489,7 @@ For a speaker muting to work when pressing a PTT, you need to enter the exact na
* The event tag is used to play an audible alert when there are changes of other users statuses
* The alert tag is used to play an WAV file into the stream to the receiving party upon a user generated panic request
* The rogerbeep tag is used to define the WAV file to play at the end of every transmission
* The tag name chimes can be misleading. This function is very powerful and can be used to define a local file or network stream that will be played into the mumble channel upon pressing the F11 key. Very useful for debugging.
* The tag name stream, This function is very powerful and can be used to define a local file or network stream that will be played into the mumble channel upon pressing the F11 key. Very useful for debugging.
##### The TXTIMEOUT section
* The txtimeout tag is used to limit the length of a single transmission in seconds. This tag is useful when used as a repeater between RF and mumble.
Expand All @@ -499,7 +499,7 @@ For a speaker muting to work when pressing a PTT, you need to enter the exact na
* The tag apilisten port defines the port that talkkonnect should listen and respond to remote control http requests
* To use httpapi you can use your browser to go to the url http://{talkkonnectip}/?command=F1 (Replace {talkkonnectip} with the IP address of your talkkonnect)
* HTTPAPI commands supported are F1 Channel Up (+), F2 Channel Down (-), F3 Mute/Unmute Speaker, F4 Current Volume Level, F5 Digital Volume Up (+), F6 Digital Volume Down (-),
F7 List Server Channels, F8 Start Transmitting, F9 Stop Transmitting, F10 List Online Users, F11 Playback/Stop Chimes, F12 For GPS Position, Ctrl-E Send Email, Ctrl-L Clear Screen,
F7 List Server Channels, F8 Start Transmitting, F9 Stop Transmitting, F10 List Online Users, F11 Playback/Stop Stream, F12 For GPS Position, Ctrl-E Send Email, Ctrl-L Clear Screen,
Ctrl-M Ping Servers, Ctrl-N Connect Next Server, Ctrl-P Panic Simulation, Ctrl-S Scan Channels, Ctrl-X Dump XML Config
Expand Down
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ type Talkkonnect struct {
PanicButtonState uint
CommentButton gpio.Pin
CommentButtonState uint
ChimesButton gpio.Pin
ChimesButtonState uint
StreamButton gpio.Pin
StreamButtonState uint
}

type ChannelsListStruct struct {
Expand Down
2 changes: 1 addition & 1 deletion clientcommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (b *Talkkonnect) TransmitStart() {
IsPlayStream = false
NowStreaming = false
time.Sleep(100 * time.Millisecond)
b.playIntoStream(ChimesSoundFilenameAndPath, ChimesSoundVolume)
b.playIntoStream(StreamSoundFilenameAndPath, StreamSoundVolume)
}

if TargetBoard == "rpi" {
Expand Down
14 changes: 7 additions & 7 deletions commandkeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func (b *Talkkonnect) cmdStartTransmitting() {
IsPlayStream = false
NowStreaming = false

b.playIntoStream(ChimesSoundFilenameAndPath, ChimesSoundVolume)
b.playIntoStream(StreamSoundFilenameAndPath, StreamSoundVolume)
}

if !b.IsTransmitting {
Expand All @@ -348,7 +348,7 @@ func (b *Talkkonnect) cmdStopTransmitting() {
IsPlayStream = false
NowStreaming = false

b.playIntoStream(ChimesSoundFilenameAndPath, ChimesSoundVolume)
b.playIntoStream(StreamSoundFilenameAndPath, StreamSoundVolume)
}

if b.IsTransmitting {
Expand Down Expand Up @@ -377,15 +377,15 @@ func (b *Talkkonnect) cmdListOnlineUsers() {
}

func (b *Talkkonnect) cmdPlayback() {
log.Println("debug: F11 pressed Start/Stop Chimes Stream into Current Channel Requested")
log.Println("debug: F11 pressed Start/Stop Stream Stream into Current Channel Requested")
log.Println("info: Stream into Current Channel")

b.BackLightTimer()

if TTSEnabled && TTSPlayChimes {
err := playWavLocal(TTSPlayChimesFilenameAndPath, TTSVolumeLevel)
if TTSEnabled && TTSPlayStream {
err := playWavLocal(TTSPlayStreamFilenameAndPath, TTSVolumeLevel)
if err != nil {
log.Println("error: playWavLocal(TTSPlayChimesFilenameAndPath) Returned Error: ", err)
log.Println("error: playWavLocal(TTSPlayStreamFilenameAndPath) Returned Error: ", err)

}

Expand All @@ -403,7 +403,7 @@ func (b *Talkkonnect) cmdPlayback() {
b.SendMessage(fmt.Sprintf("%s Streaming", b.Username), false)
}

go b.playIntoStream(ChimesSoundFilenameAndPath, ChimesSoundVolume)
go b.playIntoStream(StreamSoundFilenameAndPath, StreamSoundVolume)

}

Expand Down
22 changes: 11 additions & 11 deletions gpio.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ func (b *Talkkonnect) initGPIO() {
CommentButtonPinPullUp.PullUp()
}

if ChimesButtonPin > 0 {
ChimesButtonPinPullUp := rpio.Pin(ChimesButtonPin)
ChimesButtonPinPullUp.PullUp()
if StreamButtonPin > 0 {
StreamButtonPinPullUp := rpio.Pin(StreamButtonPin)
StreamButtonPinPullUp.PullUp()
}

if TxButtonPin > 0 || TxTogglePin > 0 || UpButtonPin > 0 || DownButtonPin > 0 || PanicButtonPin > 0 || CommentButtonPin > 0 {
Expand Down Expand Up @@ -299,23 +299,23 @@ func (b *Talkkonnect) initGPIO() {

}

if ChimesButtonPin > 0 {
if StreamButtonPin > 0 {

b.ChimesButton = gpio.NewInput(ChimesButtonPin)
b.StreamButton = gpio.NewInput(StreamButtonPin)
go func() {
for {
if IsConnected {

currentState, err := b.ChimesButton.Read()
currentState, err := b.StreamButton.Read()
time.Sleep(200 * time.Millisecond)

if currentState != b.ChimesButtonState && err == nil {
b.ChimesButtonState = currentState
if currentState != b.StreamButtonState && err == nil {
b.StreamButtonState = currentState

if b.ChimesButtonState == 1 {
log.Println("debug: Chimes Button is released")
if b.StreamButtonState == 1 {
log.Println("debug: Stream Button is released")
} else {
log.Println("debug: Chimes Button is pressed")
log.Println("debug: Stream Button is pressed")
b.cmdPlayback()
time.Sleep(200 * time.Millisecond)
}
Expand Down
6 changes: 3 additions & 3 deletions httpapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ func (b *Talkkonnect) httpAPI(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "API List Online Users Request Denied\n")
}
case "Stream-Toggle":
if APIPlayChimes {
if APIPlayStream {
b.cmdPlayback()
fmt.Fprintf(w, "API Play/Stop Chimes Request Processed Successfully\n")
fmt.Fprintf(w, "API Play/Stop Stream Request Processed Successfully\n")
} else {
fmt.Fprintf(w, "API Play/Stop Chimes Request Denied\n")
fmt.Fprintf(w, "API Play/Stop Stream Request Denied\n")
}
case "GPSPosition":
if APIRequestGpsPosition {
Expand Down
2 changes: 1 addition & 1 deletion mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (b *Talkkonnect) onMessageReceived(client MQTT.Client, message MQTT.Message
log.Println("info: MQTT List Online Users Request Processed Successfully\n")
b.cmdListOnlineUsers()
case "Stream-Toggle":
log.Println("info: MQTT Play/Stop Chimes Request Processed Successfully\n")
log.Println("info: MQTT Play/Stop Stream Request Processed Successfully\n")
b.cmdPlayback()
case "GPSPosition":
log.Println("info: MQTT Request GPS Position Processed Successfully\n")
Expand Down
2 changes: 1 addition & 1 deletion stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (b *Talkkonnect) playIntoStream(filepath string, vol float32) {
return
}

if ChimesSoundEnabled && IsPlayStream {
if StreamSoundEnabled && IsPlayStream {
if pstream != nil && pstream.State() == gumbleffmpeg.StatePlaying {
pstream.Stop()
return
Expand Down
2 changes: 1 addition & 1 deletion talkkonnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (b *Talkkonnect) talkkonnectMenu(backgroundcolor string) {
log.Println("info: " + backgroundcolor + "│ <F5> Digital Volume Up (+) │ <F6> Digital Volume Down (-) │" + backgroundreset)
log.Println("info: " + backgroundcolor + "│ <F7> List Server Channels │ <F8> Start Transmitting │" + backgroundreset)
log.Println("info: " + backgroundcolor + "│ <F9> Stop Transmitting │ <F10> List Online Users │" + backgroundreset)
log.Println("info: " + backgroundcolor + "│ <F11> Playback/Stop Chimes │ <F12> For GPS Position │" + backgroundreset)
log.Println("info: " + backgroundcolor + "│ <F11> Playback/Stop Stream │ <F12> For GPS Position │" + backgroundreset)
log.Println("info: " + backgroundcolor + "├─────────────────────────────┼────────────────────────────────┤" + backgroundreset)
log.Println("info: " + backgroundcolor + "│<Ctrl-D> Debug Stacktrace │ │" + backgroundreset)
log.Println("info: " + backgroundcolor + "├─────────────────────────────┼────────────────────────────────┤" + backgroundreset)
Expand Down
52 changes: 27 additions & 25 deletions talkkonnect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
<insecure>true</insecure>
<certificate></certificate>
<channel></channel>
<ident>Suvir Kumar</ident>
<ident>Name Surname</ident>
</account>
</accounts>
<global>
<software>
<settings>
<outputdevice>Speaker</outputdevice>
<outputdevice>Headphone Playback ZC</outputdevice>
<outputdeviceshort>Headphone</outputdeviceshort>
<logfilenameandpath>/var/log/talkkonnect.log</logfilenameandpath>
<logging>screenwithlineno</logging>
<logging>screenandfilewithlineno</logging>
<loglevel>debug</loglevel>
<daemonize>false</daemonize>
<cancellablestream>true</cancellablestream>
Expand All @@ -26,7 +27,7 @@
</settings>
<autoprovisioning enabled="false">
<tkid></tkid>
<url>http://pbx.dits.co.th</url>
<url>http://www.replaceprovisioningserverhere.com</url>
<savefilepath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect</savefilepath>
<savefilename>talkkonnect.xml</savefilename>
</autoprovisioning>
Expand Down Expand Up @@ -58,8 +59,8 @@
<stoptransmittingfilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/voiceprompts/StopTransmitting.wav</stoptransmittingfilenameandpath>
<listonlineusers>true</listonlineusers>
<listonlineusersfilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/voiceprompts/ListOnlineUsers.wav</listonlineusersfilenameandpath>
<playchimes>true</playchimes>
<playchimesfilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/voiceprompts/PlayChimes.wav</playchimesfilenameandpath>
<playstream>true</playstream>
<playstreamfilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/voiceprompts/PlayStream.wav</playstreamfilenameandpath>
<requestgpsposition>true</requestgpsposition>
<requestgpspositionfilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/voiceprompts/RequestGpsPosition.wav</requestgpspositionfilenameandpath>
<nextserver>false</nextserver>
Expand Down Expand Up @@ -93,7 +94,7 @@
</smtp>
<sounds>
<event enabled="true">
<joinedfilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/events/joined.wav</joinedfilenameandpath>
<joinedfilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/events/event.wav</joinedfilenameandpath>
<leftfilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/events/left.wav</leftfilenameandpath>
<messagefilenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/events/message.wav</messagefilenameandpath>
</event>
Expand All @@ -107,16 +108,16 @@
</incommingbeep>
<rogerbeep enabled="true">
<filenameandpath>/home/talkkonnect/gocode/src/github.com/talkkonnect/talkkonnect/soundfiles/rogerbeeps/Image.wav</filenameandpath>
<volume>0.1</volume>
<volume>1</volume>
</rogerbeep>
<repeatertone enabled="true">
<tonefrequencyhz>1750</tonefrequencyhz>
<tonedurationsec>1</tonedurationsec>
</repeatertone>
<chimes enabled="true">
<stream enabled="true">
<filenameandpath>http://prdonline.prd.go.th:8200</filenameandpath>
<volume>0.5</volume>
</chimes>
</stream>
</sounds>
<txtimeout enabled="false">
<txtimeoutsecs>60</txtimeoutsecs>
Expand All @@ -134,7 +135,7 @@
<starttransmitting>true</starttransmitting>
<stoptransmitting>true</stoptransmitting>
<listonlineusers>true</listonlineusers>
<playchimes>true</playchimes>
<playstream>true</playstream>
<requestgpsposition>true</requestgpsposition>
<previousserver>false</previousserver>
<nextserver>true</nextserver>
Expand All @@ -158,7 +159,7 @@
<printtxtimeout>false</printtxtimeout>
<printhttpapi>false</printhttpapi>
<printtargetboard>false</printtargetboard>
<printleds>false</printleds>
<printleds>true</printleds>
<printheartbeat>false</printheartbeat>
<printbuttons>false</printbuttons>
<printcomment>false</printcomment>
Expand All @@ -185,28 +186,29 @@
</software>
<hardware targetboard="rpi">
<lights>
<voiceactivityledpin>2</voiceactivityledpin>
<participantsledpin>3</participantsledpin>
<transmitledpin>4</transmitledpin>
<onlineledpin>5</onlineledpin>
<attentionledpin></attentionledpin>
<ledstripenabled>false</ledstripenabled>
<voiceactivityledpin>5</voiceactivityledpin>
<participantsledpin>6</participantsledpin>
<transmitledpin>16</transmitledpin>
<onlineledpin>1</onlineledpin>
<attentionledpin>25</attentionledpin>
</lights>
<heartbeat enabled="false">
<heartbeatledpin>2</heartbeatledpin>
<heartbeatledpin>25</heartbeatledpin>
<periodmsecs>2000</periodmsecs>
<ledonmsecs>1000</ledonmsecs>
<ledoffmsecs>1010</ledoffmsecs>
</heartbeat>
<buttons>
<txbuttonpin>26</txbuttonpin>
<txtogglepin>11</txtogglepin>
<upbuttonpin>19</upbuttonpin>
<downbuttonpin>13</downbuttonpin>
<panicbuttonpin>14</panicbuttonpin>
<chimesbuttonpin></chimesbuttonpin>
<txbuttonpin>17</txbuttonpin>
<txtogglepin></txtogglepin>
<upbuttonpin></upbuttonpin>
<downbuttonpin></downbuttonpin>
<panicbuttonpin></panicbuttonpin>
<streambuttonpin></streambuttonpin>
</buttons>
<comment>
<commentbuttonpin>9</commentbuttonpin>
<commentbuttonpin>5</commentbuttonpin>
<commentmessageoff>Standby</commentmessageoff>
<commentmessageon>Unavailable</commentmessageon>
</comment>
Expand Down
Loading

0 comments on commit 9e921c6

Please sign in to comment.