4.1 soon as I haven't implemented multi monitor support yet
This commit is contained in:
ArsenArsen 2017-06-27 18:29:08 +02:00
parent cc2562f492
commit 5d528b2435
12 changed files with 71 additions and 9 deletions

1
docs/CNAME Normal file
View File

@ -0,0 +1 @@
kshare.arsenarsen.com

45
docs/README.md Normal file
View File

@ -0,0 +1,45 @@
# **KShare**
## The open source and cross platform screen sharing software
###### Inspired by [ShareX](https://getsharex.com)
KShare is a screenshotting utility built using Qt and written in C++.
It has many features, including:
* Area capture,
* Fullscreen capture,
* Active window capture,
* Magnifier, to make those aligments,
* Drawing on screenshots (blur, shapes, text, ...),
* Recording,
* Highly customizable video codecs,
* Automatic upload/clipboard copying,
* Hotkeys,
* Color picker, and last but not least,
* Custom upload destinations
## Enough talking, show us how it looks
The main window is rather simple, with only a log, and a button in it:
![image1](http://i.imgur.com/QOebwEM.png)
The settings have quite a bit more going on:
![image2](http://i.imgur.com/kZzQzGr.png)
The area selection editor is simple:
![image3](http://i.imgur.com/kyWZk3p.jpg)
And the color picker is the simplest thing ever:
![image4](http://i.imgur.com/VIeGbdQ.jpg)
The way you select the area to record is by resizing this simple widget:
![image5](http://i.imgur.com/0iXFHnm.png)
And when you start recording there is a simple preview shown:
![image6](http://i.imgur.com/6fu33TR.png)
## Download
Currently, the only good download I provide is for Arch Linux and Ubuntu 17.04
The Arch download is on the AUR as `kshare` and `kshare-git`,
and the Ubuntu build is a .deb found on my CI: [kshare.deb](https://nativeci.arsenarsen.com/job/KShare/73/artifact/packages/simpleName.deb)
## Wait.. how do I actually use this?
Here is the wiki: [`ding`](https://github.com/ArsenArsen/KShare/wiki)

1
docs/_config.yml Normal file
View File

@ -0,0 +1 @@
theme: jekyll-theme-minimal

View File

@ -65,7 +65,7 @@ int main(int argc, char *argv[]) {
a.setQuitOnLastWindowClosed(false); a.setQuitOnLastWindowClosed(false);
a.setApplicationName("KShare"); a.setApplicationName("KShare");
a.setOrganizationName("ArsenArsen"); a.setOrganizationName("ArsenArsen");
a.setApplicationVersion("3.0"); a.setApplicationVersion("4.0");
QCommandLineParser parser; QCommandLineParser parser;
parser.addHelpOption(); parser.addHelpOption();

View File

@ -46,10 +46,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
QAction *quit = new QAction("Quit", this); QAction *quit = new QAction("Quit", this);
QAction *shtoggle = new QAction("Show/Hide", this); QAction *shtoggle = new QAction("Show/Hide", this);
QAction *fullscreen = new QAction("Take fullscreen shot", this); QAction *fullscreen = new QAction("Take fullscreen shot", this);
QAction *area = new QAction("Take area shot", this);
QAction *active = new QAction("Take area shot", this);
#ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW #ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW
QAction *area = new QAction("Screenshot active window", this); QAction *active = new QAction("Screenshot active window", this);
connect(active, &QAction::triggered, this, [] { screenshotter::activeDelayed(); }); connect(active, &QAction::triggered, this, [] { screenshotter::activeDelayed(); });
#endif #endif
QAction *picker = new QAction("Show color picker", this); QAction *picker = new QAction("Show color picker", this);
@ -57,7 +57,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
QAction *recoff = new QAction("Stop recording", this); QAction *recoff = new QAction("Stop recording", this);
menu->addActions({ quit, shtoggle, picker }); menu->addActions({ quit, shtoggle, picker });
menu->addSeparator(); menu->addSeparator();
menu->addActions({ fullscreen, area }); menu->addActions({ fullscreen, area, active });
#ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW #ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW
menu->addAction(area); menu->addAction(area);
#endif #endif
@ -159,3 +159,7 @@ void MainWindow::on_actionAbout_triggered() {
box->setAttribute(Qt::WA_DeleteOnClose); box->setAttribute(Qt::WA_DeleteOnClose);
box->show(); box->show();
} }
void MainWindow::on_actionActive_window_triggered() {
screenshotter::activeDelayed();
}

View File

@ -29,6 +29,8 @@ private slots:
void on_actionColor_Picker_triggered(); void on_actionColor_Picker_triggered();
void on_actionAbout_triggered(); void on_actionAbout_triggered();
void on_actionActive_window_triggered();
public: public:
static MainWindow *inst(); static MainWindow *inst();
explicit MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = 0);

View File

@ -70,6 +70,7 @@
</property> </property>
<addaction name="actionFullscreen"/> <addaction name="actionFullscreen"/>
<addaction name="actionArea"/> <addaction name="actionArea"/>
<addaction name="actionActive_window"/>
</widget> </widget>
<widget class="QMenu" name="menuUtilities"> <widget class="QMenu" name="menuUtilities">
<property name="title"> <property name="title">
@ -130,6 +131,11 @@
<string>About</string> <string>About</string>
</property> </property>
</action> </action>
<action name="actionActive_window">
<property name="text">
<string>Active window</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources/> <resources/>

View File

@ -26,5 +26,5 @@ DWORD PlatformBackend::pid() {
} }
WId PlatformBackend::getActiveWID() { WId PlatformBackend::getActiveWID() {
return GetForegroundWindow(); return (WId)GetForegroundWindow();
} }

View File

@ -53,7 +53,7 @@ Encoder::Encoder(QString &targetFile, QSize res, CodecSettings *settings) {
if (out->enc->codec_id == AV_CODEC_ID_GIF) if (out->enc->codec_id == AV_CODEC_ID_GIF)
out->enc->pix_fmt = AV_PIX_FMT_RGB8; out->enc->pix_fmt = AV_PIX_FMT_RGB8;
else if (out->enc->codec_id == AV_CODEC_ID_H264 || out->enc->codec_id == AV_CODEC_ID_H265) { else if (out->enc->codec_id == AV_CODEC_ID_H264 || out->enc->codec_id == AV_CODEC_ID_H265) {
av_dict_set(&dict, "preset", settings->h264Profile.toLocal8Bit().constData(), 0); av_dict_set(&dict, "preset", settings ? settings->h264Profile.toLocal8Bit().constData() : "medium", 0);
av_dict_set_int(&dict, "crf", OR_DEF(settings, h264Crf, 12), 0); av_dict_set_int(&dict, "crf", OR_DEF(settings, h264Crf, 12), 0);
} else if (out->enc->codec_id == AV_CODEC_ID_VP8 || out->enc->codec_id == AV_CODEC_ID_VP9) } else if (out->enc->codec_id == AV_CODEC_ID_VP8 || out->enc->codec_id == AV_CODEC_ID_VP9)
av_dict_set_int(&dict, "lossless", OR_DEF(settings, vp9Lossless, false), 0); av_dict_set_int(&dict, "lossless", OR_DEF(settings, vp9Lossless, false), 0);

View File

@ -84,6 +84,9 @@
<property name="currentText"> <property name="currentText">
<string notr="true">medium</string> <string notr="true">medium</string>
</property> </property>
<property name="currentIndex">
<number>5</number>
</property>
<item> <item>
<property name="text"> <property name="text">
<string>ultrafast</string> <string>ultrafast</string>

View File

@ -29,7 +29,7 @@ void screenshotter::fullscreenDelayed() {
} }
void screenshotter::activeDelayed() { void screenshotter::activeDelayed() {
QTimer::singleShot(settings::settings().value("delay", 0.5).toFloat() * 1000, &screenshotter::activeDelayed); QTimer::singleShot(settings::settings().value("delay", 0.5).toFloat() * 1000, &screenshotter::active);
} }
void screenshotter::active() { void screenshotter::active() {

View File

@ -88,7 +88,7 @@
<item row="3" column="1"> <item row="3" column="1">
<widget class="QLineEdit" name="nameScheme"> <widget class="QLineEdit" name="nameScheme">
<property name="toolTip"> <property name="toolTip">
<string>http://doc.qt.io/qt-5/qdatetime.html#toString</string> <string>%(date format)date and %ext are supported</string>
</property> </property>
<property name="text"> <property name="text">
<string>Screenshot %(yyyy-MM-dd HH:mm:ss)date.%ext</string> <string>Screenshot %(yyyy-MM-dd HH:mm:ss)date.%ext</string>
@ -126,7 +126,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Uploader selection:</string> <string>Destination:</string>
</property> </property>
</widget> </widget>
</item> </item>