Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase two #3

Merged
merged 66 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5cd406e
Moved the fonts folder inside resources
SusheelThapa Jul 29, 2022
e782436
Created Tone class
SusheelThapa Jul 29, 2022
abb89da
Added dialpad tone
SusheelThapa Jul 29, 2022
335f82c
Updated Makefile to compile tone.cpp file
SusheelThapa Jul 29, 2022
025b422
Added dialpad tone in phone call
SusheelThapa Jul 29, 2022
74ead52
Added playDialpadTone method
SusheelThapa Jul 29, 2022
aa612a6
Pipeline dialpad button click event
SusheelThapa Jul 29, 2022
fa6f292
Create new header file with class audio
SusheelThapa Jul 29, 2022
508291d
Change the name of the function to avoid confusion with audio class
SusheelThapa Jul 29, 2022
785528f
Updated Makefile to compile audio.cpp file
SusheelThapa Jul 29, 2022
13b800c
Added iphone ringtone in resources/audio folder
SusheelThapa Jul 29, 2022
b8b3fb3
Added object of audio class to handle the ringtone of phone along wit…
SusheelThapa Jul 29, 2022
aa5587a
Integrated ringtone of a phone when one client calls another client a…
SusheelThapa Jul 29, 2022
f933a77
Outgoing Tone is added
SusheelThapa Jul 29, 2022
86835b8
Integrated Outgoing Tone when one client call another
SusheelThapa Jul 29, 2022
91fbde3
Change the file to store the server log
SusheelThapa Jul 29, 2022
93fcff9
Server will generate log message which will be store in logs.log file
SusheelThapa Jul 29, 2022
cf704d3
Before writing log message to file, we will write the date and time w…
SusheelThapa Jul 29, 2022
60f8683
click and sound play for button 1 and 2
SauravKumarMahato Jul 30, 2022
a2919d7
added tone for different buttons in both client one and client two
SauravKumarMahato Jul 30, 2022
da5741c
If the one client doesn't pick up the call under 15 second then call …
SusheelThapa Jul 30, 2022
a3c6af1
made timeReset function
SauravKumarMahato Jul 30, 2022
2db04f0
Merge branch 'phase-two' of github.com:SusheelThapa/A-Phone-Call into…
SusheelThapa Jul 30, 2022
6e7c251
Remove unnecessary comment and space
SusheelThapa Jul 30, 2022
3f4b25b
Change the name of function to sensible name
SusheelThapa Jul 30, 2022
ced2df6
incresed the intensity of outgoing-tone.wav
SauravKumarMahato Jul 30, 2022
03db713
Fix error in call connected time while calling again client one after…
SusheelThapa Jul 30, 2022
3d855c0
Merge branch 'phase-two' of github.com:SusheelThapa/A-Phone-Call into…
SusheelThapa Jul 30, 2022
19724f8
Initialization the calling person name fixed
SauravKumarMahato Jul 30, 2022
705e00d
updated audio file amplitude
SauravKumarMahato Jul 30, 2022
37d0422
made sounding part and completed string getting part for rendering
SauravKumarMahato Jul 30, 2022
59a4d3e
updated phone.hpp and phone.cpp for dialpad function purpose
SauravKumarMahato Jul 30, 2022
5798fd4
Merge branches 'phase-two' and 'phase-two' of github.com:SusheelThapa…
SusheelThapa Jul 30, 2022
7a989c6
added 1.png 2.png 3.png 4.png 5.png images of animation of incoming call
SauravKumarMahato Jul 30, 2022
7a9136e
Rename the incoming call images
SusheelThapa Jul 30, 2022
67f1d0d
Added animation in incoming call
SusheelThapa Jul 30, 2022
fbc0883
Changes to header file are also detected by Makefile
SusheelThapa Jul 30, 2022
cf018fc
made SwitchOn folder and kept images from switch_on_0 to switch_on_9
SauravKumarMahato Jul 30, 2022
ffa1e4d
Rename folder name
SusheelThapa Jul 30, 2022
f8e7c50
Added animation while starting up phone
SusheelThapa Jul 30, 2022
3c31324
End call tone
SusheelThapa Jul 30, 2022
b416961
Play end call tone when end call button is press while client are con…
SusheelThapa Jul 30, 2022
653a414
Update install.sh to install git
SusheelThapa Jul 30, 2022
d8803a3
added busy-tone.wav file
SauravKumarMahato Jul 30, 2022
9000a9e
made dialpad_with_back_arrow.png
SauravKumarMahato Jul 30, 2022
fc3b8f2
Play the busy tone when the call is rejected
SusheelThapa Jul 30, 2022
4911373
changed dial_pad.png with new one, dial number texture rendered and d…
SauravKumarMahato Jul 30, 2022
1dfbf4c
fixed the typo while appending 4
SauravKumarMahato Jul 30, 2022
ecf4826
removed test printing string in console
SauravKumarMahato Jul 30, 2022
34feda3
Implement Call Ending tone feature after clients press the end call b…
SusheelThapa Jul 30, 2022
46ff7a8
Fixed error in the displaying the name of the person to whom they are…
SusheelThapa Jul 30, 2022
aec6558
solved problem of number still displaying after call ending
SauravKumarMahato Jul 30, 2022
ae59a6b
Merge branch 'phase-two' of github.com:SusheelThapa/A-Phone-Call into…
SauravKumarMahato Jul 30, 2022
7a65f69
Updated the position of call end after client end the connected call
SusheelThapa Jul 30, 2022
083c978
back button work to remove a number in dial pad screen job done
SauravKumarMahato Jul 30, 2022
ec49c59
Merge branch 'phase-two' of github.com:SusheelThapa/A-Phone-Call into…
SauravKumarMahato Jul 30, 2022
bb7d451
opening color animation made different for two different color
SauravKumarMahato Jul 30, 2022
1e33b84
Optimized the checking of which number was clicked in dial pad
SusheelThapa Jul 30, 2022
f84a479
Fix error in end button click in both client
SusheelThapa Jul 30, 2022
00873ea
Change the clear screen color to green
SusheelThapa Jul 30, 2022
824225e
resolved the error when pressed backspace when there is no entered nu…
SauravKumarMahato Jul 30, 2022
8779c9f
Updated Screenshot for Phase Two
SusheelThapa Jul 30, 2022
0da2018
Updated screenshot section of Readme
SusheelThapa Jul 30, 2022
00194c1
updated Readme.md , Phase two , text part
SauravKumarMahato Jul 30, 2022
89fea26
Merge branch 'phase-two' of github.com:SusheelThapa/A-Phone-Call into…
SauravKumarMahato Jul 30, 2022
29735b9
Added more screenshots in Screenshots folder and updated Readme.md
SauravKumarMahato Jul 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added dialpad tone in phone call
  • Loading branch information
SusheelThapa committed Jul 29, 2022
commit 025b4223f065186379a42680bf52ddb28bdec639
5 changes: 4 additions & 1 deletion include/phone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
#include <SDL2/SDL_ttf.h>
#include <string>

#include "texture.hpp"
#include "window.hpp"
#include "texture.hpp"
#include "tone.hpp"

enum PhoneScreen
{
Expand Down Expand Up @@ -59,6 +60,8 @@ class Phone

Time call_connected_time;

Tone dialpad_tone[10];

public:
Phone(Window &window, std::string name);

Expand Down
1 change: 1 addition & 0 deletions include/window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL_mixer.h>

#include <iostream>
#include <string>
Expand Down
20 changes: 16 additions & 4 deletions src/phone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,23 @@ Phone::Phone(Window &window, std::string name)
this->calling_person_name = "Client One";

/*Loading the TTF Font*/
big_font = TTF_OpenFont("fonts/freesans.ttf", 56);
medium_font = TTF_OpenFont("fonts/freesans.ttf", 32);
big_font = TTF_OpenFont("resources/fonts/freesans.ttf", 56);
medium_font = TTF_OpenFont("resources/fonts/freesans.ttf", 32);

/*Setting the value of start time after call connected*/
start_time = 0;

/*Loading Dialpad tone*/
dialpad_tone[0].setAudioPath("resources/audio/tone-zero.wav");
dialpad_tone[1].setAudioPath("resources/audio/tone-one.wav");
dialpad_tone[2].setAudioPath("resources/audio/tone-two.wav");
dialpad_tone[3].setAudioPath("resources/audio/tone-three.wav");
dialpad_tone[4].setAudioPath("resources/audio/tone-four.wav");
dialpad_tone[5].setAudioPath("resources/audio/tone-five.wav");
dialpad_tone[6].setAudioPath("resources/audio/tone-six.wav");
dialpad_tone[7].setAudioPath("resources/audio/tone-seven.wav");
dialpad_tone[8].setAudioPath("resources/audio/tone-eight.wav");
dialpad_tone[9].setAudioPath("resources/audio/tone-nine.wav");
}

void Phone::setScreen(PhoneScreen screen)
Expand Down Expand Up @@ -95,7 +107,7 @@ void Phone::render(Window &window)
calling_person.getHeight()};

calling_person.render(window, 0, 0, nullptr, &render_calling_person_rect);
}
}
else if (current_screen == CALL_CONNECTED)
{
outgoing_call.render(window, 0, 0, nullptr, nullptr);
Expand Down Expand Up @@ -148,4 +160,4 @@ void Phone::startCallTime()
void Phone::endCallTime()
{
start_time = 0;
}
}
7 changes: 6 additions & 1 deletion src/tone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Tone::Tone(std::string audio_path)
void Tone::setAudioPath(std::string audio_path)
{
this->audio_path = audio_path;
this->tone_audio = Mix_LoadWAV(audio_path.c_str());
this->tone_audio = Mix_LoadWAV(this->audio_path.c_str());

/*Checking if the audio is loaded or not*/
if (this->tone_audio == nullptr)
Expand All @@ -35,3 +35,8 @@ void Tone::play()
// Audio is playing
Mix_PlayChannel(-1, this->tone_audio, 0);
}

std::string Tone::getAudioPath()
{
return this->audio_path;
}
13 changes: 13 additions & 0 deletions src/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ bool Window::init()

#endif

#if defined SDL_MIXER_MAJOR_VERSION

/*Initialize SDL_mixer*/
if(Mix_OpenAudio(44100,MIX_DEFAULT_FORMAT,2,2046) < 0 )
{
std::cout<<"SDL_Mixer cannot be initialize"
<< std::endl
<< "SDL_Error: "
<< Mix_GetError()
<<std::endl;
}
#endif

return status;
}

Expand Down