Skip to content

Commit

Permalink
Merge pull request #2 from cheezymousehouse825/add-sound
Browse files Browse the repository at this point in the history
Add sound
  • Loading branch information
cheezymousehouse825 authored Oct 26, 2021
2 parents ba97ce1 + aefe97c commit db4b8bb
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 27 deletions.
84 changes: 60 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<div id="top"></div>
<!--
*** Thanks for checking out the Best-README-Template. If you have a suggestion
*** that would make this better, please fork the repo and create a pull request
*** or simply open an issue with the tag "enhancement".
*** Don't forget to give the project a star!
*** Thanks again! Now go create something AMAZING! :D
***
***
***
*** To avoid retyping too much info. Do a search and replace for the following:
*** cheezymousehouse825, hampter, cheezymh825, [email protected], Hampter, A useless window that displays a hamster
-->


Expand All @@ -31,32 +28,32 @@

<!-- PROJECT LOGO -->
<br />
<p align="center">
<div align="center">
<a href="https://github.com/cheezymousehouse825/hampter">
<img src="images/logo.png" alt="Logo" width="80" height="80">
</a>

<h3 align="center">Hampter</h3>
<h3 align="center">Hampter</h3>

<p align="center">
A useless window that displays a hamster
Useless window to display an image of a hamster.
<br />
<a href="https://github.com/cheezymousehouse825/hampter"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://youtu.be/03mSQP930sk">View Demo</a>
<a href="https://github.com/cheezymousehouse825/hampter">View Demo</a>
·
<a href="https://github.com/cheezymousehouse825/hampter/issues">Report Bug</a>
·
<a href="https://github.com/cheezymousehouse825/hampter/issues">Request Feature</a>
</p>
</p>
</div>



<!-- TABLE OF CONTENTS -->
<details open="open">
<summary><h2 style="display: inline-block">Table of Contents</h2></summary>
<details>
<summary>Table of Contents</summary>
<ol>
<li>
<a href="#about-the-project">About The Project</a>
Expand All @@ -76,7 +73,7 @@
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#acknowledgements">Acknowledgements</a></li>
<li><a href="#acknowledgments">Acknowledgments</a></li>
</ol>
</details>

Expand All @@ -85,26 +82,30 @@
<!-- ABOUT THE PROJECT -->
## About The Project

[![Product Name Screen Shot][product-screenshot]](https://github.com/cheezymousehouse825/)
[![Hampter Screenshot][product-screenshot]](https://github.com/cheezymousehouse825/hampter/raw/main/images/screenshot.png)

<p align="right">(<a href="#top">back to top</a>)</p>


This is a useless project that displays an image of a hamster. I made it just to practice using git in the terminal, to learn gui making with c++, and to learn more about github in general.

### Built With

* [C++](http://www.cplusplus.com/)
* [wxWidgets](https://wxwidgets.org/)
* [GCC](https://gcc.gnu.org/)
* [FFmpeg](https://ffmpeg.org/)

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- GETTING STARTED -->
## Getting Started

To get a local copy up and running follow these simple steps.
To get a local copy up and running follow these simple example steps.

### Prerequisites

This is an example of how to list things you need to use the software and how to install them.
* GCC
```sh
sudo pacman -S gcc
Expand All @@ -115,13 +116,20 @@ This is an example of how to list things you need to use the software and how to
sudo pacman -S wxgtk2
```

* FFmpeg (for linux users only)
```sh
sudo pacman -S ffmpeg
```

_Please note that for the windows executable, there are no prerequisites. For the linux binary you will need FFmpeg and wxWidgets. You won't need GCC because the binary is pre-compiled._

### Installation

1. Clone the repo
```sh
git clone https://github.com/cheezymousehouse825/hampter.git
```
2. Cd into the directory
2. Enter the directory
```sh
cd hampter
```
Expand All @@ -130,41 +138,65 @@ This is an example of how to list things you need to use the software and how to
g++ main.cpp `wx-config --cxxflags --libs` -o hampter
```

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- USAGE EXAMPLES -->
## Usage

Execute the program:
Execute the program by running `start.sh`
```sh
./hampter
./start.sh
```

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- ROADMAP -->
## Roadmap

See the [open issues](https://github.com/cheezymousehouse825/hampter/issues) for a list of proposed features (and known issues).
- [x] Add More Dialogue
- [x] Add Sounds
- [] Multiple Windows
- [] Multiple Hamsters
- [] Random Images
- [] Make it Annoying
- [] Impossible To Close
- [] Plays Annoying Noises at Random Times

See the [open issues](https://github.com/cheezymousehouse825/hampter/issues) for a full list of proposed features (and known issues).

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- CONTRIBUTING -->
## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- LICENSE -->
## License

Distributed under the GPL-3.0 License. See `LICENSE` for more information.

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- CONTACT -->
Expand All @@ -174,13 +206,17 @@ Vaughn MacIntyre - [@cheezymh825](https://twitter.com/cheezymh825) - vaughn.maci

Project Link: [https://github.com/cheezymousehouse825/hampter](https://github.com/cheezymousehouse825/hampter)

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- ACKNOWLEDGEMENTS -->
## Acknowledgements
<!-- ACKNOWLEDGMENTS -->
## Acknowledgments

* [Gorillaz](https://www.gorillaz.com/)
* [Me](https://github.com/cheezymousehouse825/)

<p align="right">(<a href="#top">back to top</a>)</p>



Expand Down
18 changes: 15 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <wx/wx.h>
#include <wx/sizer.h>
#ifdef _WIN32
#include <stdio.h>
#include <MMsystem.h>
#include <windows.h>
#endif

class wxImagePanel : public wxPanel
{
Expand Down Expand Up @@ -136,7 +143,6 @@ void wxImagePanel::OnSize(wxSizeEvent& event){

class MyApp: public wxApp
{

wxFrame *frame;
wxImagePanel * drawPane;
public:
Expand Down Expand Up @@ -169,9 +175,15 @@ class MyApp: public wxApp
frame->SetSizer(sizer);

frame->Show();
#ifdef _WIN32
PlaySound(TEXT("sound.wav"),NULL,SND_ASYNC);
#endif
#ifdef linux
system("ffplay -nodisp sound.wav &>/dev/null &");
#endif

return true;
}

}
};

IMPLEMENT_APP(MyApp)
Binary file added sound.wav
Binary file not shown.
4 changes: 4 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

./hampter
pkill ffplay

0 comments on commit db4b8bb

Please sign in to comment.