summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-27 17:57:44 +0100
committerDavid Robillard <d@drobilla.net>2020-11-27 21:42:51 +0100
commitf80e8274555f0da157e0b8c1fcae975d66178ab7 (patch)
treed240f930d062b69bb5b8fd4ca4f253d2280ba968 /src
parent5f5e293345a063ab7b274edcc76d329891503379 (diff)
downloadpatchage-f80e8274555f0da157e0b8c1fcae975d66178ab7.tar.gz
patchage-f80e8274555f0da157e0b8c1fcae975d66178ab7.tar.bz2
patchage-f80e8274555f0da157e0b8c1fcae975d66178ab7.zip
Use "using"
Diffstat (limited to 'src')
-rw-r--r--src/AlsaDriver.hpp15
-rw-r--r--src/Patchage.cpp5
-rw-r--r--src/PatchageCanvas.cpp2
-rw-r--r--src/PatchageCanvas.hpp13
4 files changed, 17 insertions, 18 deletions
diff --git a/src/AlsaDriver.hpp b/src/AlsaDriver.hpp
index a1de0e7..94dd101 100644
--- a/src/AlsaDriver.hpp
+++ b/src/AlsaDriver.hpp
@@ -1,5 +1,5 @@
/* This file is part of Patchage.
- * Copyright 2007-2014 David Robillard <http://drobilla.net>
+ * Copyright 2007-2020 David Robillard <d@drobilla.net>
*
* Patchage is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
@@ -95,14 +95,13 @@ private:
}
};
- typedef std::set<snd_seq_addr_t, SeqAddrComparator> Ignored;
- Ignored _ignored;
+ using Ignored = std::set<snd_seq_addr_t, SeqAddrComparator>;
+ using Modules = std::multimap<uint8_t, PatchageModule*>;
+ using PortAddrs = std::map<PatchagePort*, PortID>;
- typedef std::multimap<uint8_t, PatchageModule*> Modules;
- Modules _modules;
-
- typedef std::map<PatchagePort*, PortID> PortAddrs;
- PortAddrs _port_addrs;
+ Ignored _ignored;
+ Modules _modules;
+ PortAddrs _port_addrs;
bool ignore(const snd_seq_addr_t& addr, bool add = true);
};
diff --git a/src/Patchage.cpp b/src/Patchage.cpp
index 022eace..997365d 100644
--- a/src/Patchage.cpp
+++ b/src/Patchage.cpp
@@ -1000,8 +1000,9 @@ Patchage::on_export_image()
dialog.set_default_response(Gtk::RESPONSE_OK);
dialog.set_transient_for(*_main_win);
- typedef std::map<std::string, std::string> Types;
- Types types;
+ using Types = std::map<std::string, std::string>;
+
+ Types types;
types["*.dot"] = "Graphviz DOT";
types["*.pdf"] = "Portable Document Format";
types["*.ps"] = "PostScript";
diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp
index 36a815e..1dfe9e0 100644
--- a/src/PatchageCanvas.cpp
+++ b/src/PatchageCanvas.cpp
@@ -134,7 +134,7 @@ PatchageCanvas::remove_port(const PortID& id)
struct RemovePortsData
{
- typedef bool (*Predicate)(const PatchagePort*);
+ using Predicate = bool (*)(const PatchagePort*);
RemovePortsData(Predicate p)
: pred(p)
diff --git a/src/PatchageCanvas.hpp b/src/PatchageCanvas.hpp
index 35d0abb..0b200f4 100644
--- a/src/PatchageCanvas.hpp
+++ b/src/PatchageCanvas.hpp
@@ -1,5 +1,5 @@
/* This file is part of Patchage.
- * Copyright 2007-2014 David Robillard <http://drobilla.net>
+ * Copyright 2007-2020 David Robillard <d@drobilla.net>
*
* Patchage is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
@@ -71,16 +71,15 @@ public:
void clear();
private:
- Patchage* _app;
+ using PortIndex = std::map<const PortID, PatchagePort*>;
+ using ModuleIndex = std::multimap<const std::string, PatchageModule*>;
bool on_event(GdkEvent* ev);
bool on_connection_event(Ganv::Edge* c, GdkEvent* ev);
- typedef std::map<const PortID, PatchagePort*> PortIndex;
- PortIndex _port_index;
-
- typedef std::multimap<const std::string, PatchageModule*> ModuleIndex;
- ModuleIndex _module_index;
+ Patchage* _app;
+ PortIndex _port_index;
+ ModuleIndex _module_index;
};
#endif // PATCHAGE_PATCHAGECANVAS_HPP