Skip to content

Commit

Permalink
user can now do customization to voice and typing effect
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal2376 committed Nov 18, 2021
1 parent 88e38cc commit dcbb206
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Linux/assistant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void assistant::load_settings()
file.close();
}

void assistant::save_settings(string un, int ss, int sa, int sp, int ts)
void assistant::save_settings(string un = "Vishal", int ss = 160, int sa = 100, int sp = 40, int ts = 40)
{
ofstream file;
file.open(".user-settings", ios::out);
Expand Down
48 changes: 42 additions & 6 deletions Linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ void lists(string); //show song list
void convert(string&); //convert 'space( )' to 'underscore'( _ ) and lowercase string
void srch(string, string extra = "");
void update_song(string); //copy song name from different files(list.txt) file into one file(songs.txt)

void settings(); // user settings

int main()
{
init(); // init hydron

user_name = get_uname();
save_settings("singh", 160, 100, 30, 20);

repeat();

return 0;
Expand Down Expand Up @@ -122,7 +122,8 @@ void check()
usleep(t_const * 600);
cout << "\n\n\n\n\n\n\t\t\t\t\t";
typing("Created By : Vishal Singh");
usleep(t_const * 1500);
usleep(t_const * 1000);
system("clear");
exit(1);
}
else if (input == "find ip" || input == "find my ip" || m_word == "ip")
Expand Down Expand Up @@ -163,6 +164,9 @@ void check()
srch(input);
}

else if (input == "settings" || input == "setting" || input == "set")
settings();

else if (m_word == "song" || m_word == "music")
srch(s_word, "song");

Expand All @@ -184,6 +188,9 @@ void check()
usleep(t_const * 300);
}

else if (input == "help")
help();

else if (m_word == "movie")
srch(s_word, "movie");

Expand All @@ -193,9 +200,6 @@ void check()
else if (m_word == "search")
srch(s_word);

else if (input == "help")
help();

else if (m_word == "cmd")
system(s_word.c_str());

Expand Down Expand Up @@ -241,6 +245,7 @@ void check()
else
openf(s_word);
}

else
{
speak("Sorry " + user_name + ", unknown command...");
Expand All @@ -262,6 +267,37 @@ void check()
repeat();
}

//-----------------------user settings---------------------
void settings()
{
string un;
int ss, sa, sp, ts;

cout << "\n\n";
typing("Enter data in the following given format:\n");
cout << "\nuser name(single word only)";
cout << "\nspeak speed(in WPM)";
cout << "\nspeak volume(0-200)";
cout << "\nspeak pitch(0-99)";
cout << "\ntyping speed(in ms)";
cout << "\n\nExample 1:\n";
cout << "Vishal 160 100 40 40";
cout << "\n\nExample 2:\n";
cout << "Vishal 150 120 60 30";
cout << "\n\n\n---> ";
cin >> un >> ss >> sa >> sp >> ts;
if ((sa <= 200 && sa > 0) && (sp <= 99 && sp > 0 ))
{
save_settings(un, ss, sa, sp, ts);
speak("Restart hydron to see changes");
}
else
{
speak("Something went wrong");
}
cin.ignore('\n');
}

//------------------------------player function------------------------//
void player(string item)
{
Expand Down

0 comments on commit dcbb206

Please sign in to comment.