added db conversions and new menu into project panel

This commit is contained in:
itsmattkc
2019-07-21 19:04:32 -07:00
parent f8830beac7
commit 1d25fbd9e7
6 changed files with 50 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
#include "decibel.h"
decibel::decibel()
{
}
+18
View File
@@ -0,0 +1,18 @@
#ifndef DECIBEL_H
#define DECIBEL_H
/**
* @brief Converts an amplitude into a value in decibels
*
* Converts a 0.0-1.0 amplitude into an infinity-0.0 decibel value
*/
double amplitude_to_db(double amplitude);
/**
* @brief Converts decibels into an amplitude value
*
* Converts an infinity-0.0 decibel value into a 0.0-1.0 amplitude
*/
double db_to_amplitude(double db);
#endif // DECIBEL_H
+14
View File
@@ -20,9 +20,11 @@
#include "project.h"
#include <QMenu>
#include <QVBoxLayout>
#include "core.h"
#include "widget/menu/menushared.h"
#include "widget/projecttoolbar/projecttoolbar.h"
ProjectPanel::ProjectPanel(QWidget *parent) :
@@ -39,6 +41,9 @@ ProjectPanel::ProjectPanel(QWidget *parent) :
ProjectToolbar* toolbar = new ProjectToolbar(this);
layout->addWidget(toolbar);
// Make toolbar connections
connect(toolbar, SIGNAL(NewClicked()), this, SLOT(ShowNewMenu()));
// Set up main explorer object
explorer_ = new ProjectExplorer(this);
layout->addWidget(explorer_);
@@ -117,3 +122,12 @@ void ProjectPanel::ItemDoubleClickSlot(Item *item)
// FIXME: Double click Item should do something
}
void ProjectPanel::ShowNewMenu()
{
Menu new_menu(this);
olive::menu_shared.AddItemsForNewMenu(&new_menu);
new_menu.exec(QCursor::pos());
}
+2
View File
@@ -56,6 +56,8 @@ private:
private slots:
void ItemDoubleClickSlot(Item* item);
void ShowNewMenu();
};
#endif // PROJECT_PANEL_H
+5
View File
@@ -42,6 +42,11 @@ Menu::Menu(Menu *menu, const QObject *receiver, const char *member) :
}
}
Menu::Menu(QWidget *parent) :
QMenu(parent)
{
}
QAction *Menu::AddItem(const QString &id,
const QObject *receiver,
const char *member,
+5
View File
@@ -58,6 +58,11 @@ public:
*/
Menu(Menu* bar, const QObject* receiver = nullptr, const char* member = nullptr);
/**
* @brief Construct a popup menu
*/
Menu(QWidget* parent);
/**
* @brief Create a menu item and add it to this menu
*