Skip to content

Commit

Permalink
Pass ringtone by pointer
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Aug 22, 2016
1 parent fa42d95 commit c8e3078
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions gammu/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void PrintBatteryCharge(GSM_BatteryCharge *BatteryCharge)
}
}

GSM_Error GSM_PlayRingtone(GSM_Ringtone ringtone)
GSM_Error GSM_PlayRingtone(GSM_Ringtone *ringtone)
{
int i;
gboolean first=TRUE;
Expand All @@ -204,11 +204,11 @@ GSM_Error GSM_PlayRingtone(GSM_Ringtone ringtone)
signal(SIGINT, interrupt);
printf("%s\n", _("Press Ctrl+C to break..."));

for (i=0;i<ringtone.NoteTone.NrCommands;i++) {
for (i = 0; i < ringtone->NoteTone.NrCommands; i++) {
if (gshutdown) break;
if (ringtone.NoteTone.Commands[i].Type != RING_Note) continue;
error=PHONE_RTTLPlayOneNote(gsm,ringtone.NoteTone.Commands[i].Note,first);
if (error!=ERR_NONE) return error;
if (ringtone->NoteTone.Commands[i].Type != RING_Note) continue;
error = PHONE_RTTLPlayOneNote(gsm, ringtone->NoteTone.Commands[i].Note, first);
if (error != ERR_NONE) return error;
first = FALSE;
}

Expand All @@ -230,7 +230,7 @@ void PlayRingtone(int argc UNUSED, char *argv[])

GSM_Init(TRUE);

error=GSM_PlayRingtone(ringtone2);
error = GSM_PlayRingtone(&ringtone2);
Print_Error(error);

GSM_Terminate();
Expand Down
2 changes: 1 addition & 1 deletion gammu/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern void SetAutoNetworkLogin(int argc, char *argv[]);
extern void GetFMStation(int argc, char *argv[]);
extern void CallDivert(int argc, char *argv[]);
extern void CancelAllDiverts(int argc, char *argv[]);
extern GSM_Error GSM_PlayRingtone(GSM_Ringtone ringtone);
extern GSM_Error GSM_PlayRingtone(GSM_Ringtone *ringtone);
extern void Battery(int argc, char *argv[]);
extern void Screenshot(int argc, char *argv[]);
extern void Install(int argc, char *argv[]);
2 changes: 1 addition & 1 deletion helper/message-display.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ void DisplayMultiSMSInfo (GSM_MultiSMSMessage *sms, gboolean eachsms, gboolean e
#if 0
/* Disabled for now */
if (answer_yes("%s", _("Do you want to play it?")))
GSM_PlayRingtone(*SMSInfo.Entries[i].Ringtone);
GSM_PlayRingtone(SMSInfo.Entries[i].Ringtone);
#endif
break;
case SMS_NokiaCallerLogo:
Expand Down

0 comments on commit c8e3078

Please sign in to comment.